Default mappings
In cases where the default mappings or search are not sufficient for your needs, you can use the HL7v2ModuleMapping
resource.
There are a few options with this resource to make the mapping process more flexible:
baseResourceType
- this is for future use to map different message types, for now only one available is DocumentReference. Anyway, this wouldtype
- HL7v2 message type.searchQuery
- This is used to define the search query, excluding the "_id" part..mapping
- most important part of this resource. The main idea here is that the resource mapping overrides the default segments mapping of the module. This part looks like key-value structure with segment and field names as keys and several options objects as values:fhirPath
- You can define the fhirPath expression for each field or type component. This will be evaluated using the search bundle result. The search bundle is converted for easier use of fhirPath. The updated structure uses theentry
value as the root under theresources
key and resolves all references as resources, so keep in mind that if, for example,Encounter.subject
reference is provided - it should automatically be converted to the entire Patient resource.fixedValue
- You can use this property to hardcode some values that shouldn't vary from message to message. When this property is provided, type mapping is skipped for that field.req
- By default, the module attempts to validate the existence of segments and fields required by the HL7v2 specification (ver 2.3.1 for this iteration). You can change this behavior by setting this property to true or false for each field.type
- By default, the module tries to resolve types according to the HL7v2 specification. If one of these types is not what you need to generate - you can define one of the existing supported HL7v2 types or define your own custom type. It uses the same concepts as field mapping, so either req, type or fhirPath should work the same way.
opts
- some other options (currently only 1)timeZone
– Timezone offset must match the pattern:Z
,±h
,±hh
,±hh:mm
,±hhmm
,±hh:mm:ss
,±hhmmss
Example:
Last updated
Was this helpful?