HL7 Version 2 to FHIR
1.0.0 - STU 1 International flag

HL7 Version 2 to FHIR, published by HL7 International / Orders and Observations. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/v2-to-fhir/ and changes regularly. See the Directory of published versions

ConceptMap: Segment MSH to MessageHeader Map (Experimental)

Official URL: http://hl7.org/fhir/uv/v2mappings/ConceptMap/segment-msh-to-messageheader Version: 1.0.0
Standards status: Informative Computable Name: SegmentMSHToMessageHeader

Copyright/Legal: Copyright (c) 2025, HL7 International, Inc., All Rights Reserved.

This ConceptMap represents a mapping from the HL7 V2 Segment MSH to the FHIR MessageHeader Resource.

This ConceptMap represents the mapping from the HL7 V2 MSH Segment to the FHIR MessageHeader Resource. See also the FHIR Shorthand or the CSV Source.

HL7 v2Condition (IF True, args)HL7 FHIRComments
Sort OrderIdentifierNameData TypeCardinality - MinCardinality - MaxComputable ANTLRComputable FHIRPathNarrativeFHIR AttributeExtensionData TypeCardinality - MinCardinality - MaxData Type MappingVocabulary Mapping
(IS, ID, CE, CEN, CWE)
Assignment
1MSH-1Field SeparatorST11Field separators are not used in FHIR.
2MSH-2Encoding CharactersST11Encoding characters are not used in FHIR.
3MSH-3Sending ApplicationHD01MessageHeader.source11HD[MessageHeader.source-name]
3MSH-3Sending ApplicationHD01IF MSH-24 NOT VALUEDMessageHeader.source.endpointuri11HD[MessageHeader.source-endpoint]We believe that if MSH-24 is vaued, although MSH-24 is rarely valued, it contains better information for the MessageHeader.source.endpoint than MSH-3. However, one may either still want to use MSH-3 in total or a combination of content from MSH-3 and MSH-24. That is a local implementation decision to adjust the mapping accordingly based on clear knowledge of the content. If both MSH-3 and MSH-24 are not valued, which is valid in HL7 v2, then the implementer needs to resolve how to assign MessageHeader.source as it is a required attribute. Note that a data absent reason extension could be used to provide a reason and satisfy the mandatory FHIR attribute rules. But do note that the use of the data-absent-reason extension may result in a FHIR resource that is not usable by the recipient.
4MSH-4Sending FacilityHD01MessageHeader.sender(MessageHeader.Organization)Reference(MessageHeader.Organization)01HD[Organization]
5MSH-5Receiving ApplicationHD01MessageHeader.destination.target(MessageHeader.Device)Reference(MessageHeader.Device)01HD[Device]Similar as for MSH-3, MSH-5 is paired with MSH-25 and depending on local use may need to use one, the other, or a combination of both. We believe that MSH-25, when valued, provides the better information given its addition to the standard more recently.
5MSH-5Receiving ApplicationHD01IF MSH-25 VALUEDMessageHeader.destination.nameMessageHeader.nameHD[MessageHeader.destination-name]
5MSH-5Receiving ApplicationHD01IF MSH-25 NOT VALUEDMessageHeader.destination.endpointurlHD[MessageHeader.destination-endpoint]
6MSH-6Receiving FacilityHD0-1IF MSH-23 NOT VALUEDMessageHeader.destination.receiver(MessageHeader.Organization)Reference(MessageHeader.Organization)01HD[Organization]
7MSH-7Date/Time of MessageDTM11If a message is always conveyed in a Bundle, then Bundle.timestamp could work. However, Bundle.timestamp may be better used to reflect the conversion. See https://chat.fhir.org/#narrow/stream/179188-v2-to.20FHIR/topic/MessageHeader.2Etimestamp for a discussion on this topic.
7MSH-7Date/Time of MessageDTM11
8MSH-8SecurityST01meta.securitystring0-1
9MSH-9Message TypeMSG11MessageHeader.eventCodingCoding01MSG[Coding]
10MSH-10Message Control IDST11Need a gForge to request a MessageHeader.identifier (https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=20704&start=0) Note that if a message is part of a batch, then the MSH goes to a "sub-bundle".. Note that as messages switch from V2 to FHIR and the response back from FHIR to V2, the "mapping engine" needs to track the actual MSH.10.00.00 value and Bundle.identifier value to connect responses correctly.
11MSH-11Processing IDPT11MetaMeta0-1PT[Meta]
12MSH-12Version IDVID11We agreed that the version of the v2 message that was used to transform into FHIR is addressed through Provenance. Either the Provenance instance representing the original message can include in Provenance.entity.what a binary of the total original message, or the proposed MessageHeader.identifier containing MSH-10 provides the link to the original message.
13MSH-13Sequence NumberNM01
14MSH-14Continuation PointerST01There is no continuation pointer concept in FHIR. When a continuation is used, the mapper needs to continue to obtain the additional data that is defined in the mappings.
15MSH-15Accept Acknowledgment TypeID01This field is not mapped as there is no continuation of a system level acknowledgement request beyond the mapping engine. Any subsequent acknowledgement methods would be performed in the applicable subsequent transport methods.
16MSH-16Application Acknowledgment TypeID01Interacting with the recipient on what type/level or validation is asked to be reported and it is not yet clear what the appropriate mechanism is, e.g., using interactions using Task (as it is more application level interactions) and/or HTTP header and/or other mechanisms. Note that the MSH-16 values are typically pre-determined through an implementation guide. Until then we encourage implementers to share feedback on how they are planning to address this that we can consider for inclusion
17MSH-17Country CodeID01MessageHeader.sender(MessageHeader.Organization.address.country)string01CountryCode
18MSH-18Character SetID0-1extension??-characterSet
19MSH-19Principal Language Of MessageCWE01MessageHeader.languagecode01CWE[Code]PrincipalLanguageOfMessageThis does only cover the MessageHeader resource. Need to have clarity that if other resources that are part of the message that do not have Resource.meta.language valued, then it is assumed to follow MessageHeader.meta.language?? Doesn't seem RESTful, so what is the default for Resource.meta.language?
20MSH-20Alternate Character Set Handling SchemeID01
21MSH-21Message Profile IdentifierEI0-1extension??-v2ProfileID.uriuri01Need to support multiple profiles. Also, comment on implicitRules is highly idealistic.
21MSH-21Message Profile IdentifierEI0-1extension??-v2ProfileID.valueStringstring11
22MSH-22Sending Responsible OrganizationXON01MessageHeader.responsible(MessageHeader.Organization)Reference(MessageHeader.Organization)01XON[Organization]
23MSH-23Receiving Responsible OrganizationXON01MessageHeader.destination.receiver(MessageHeader.Organization)Reference(MessageHeader.Organization)0-1XON[Organization]This is an alternate representation of MSH-6. The local implementation needs to determine whech components of HD vs. XON to be used and whether it may even yield a separate Organization reference.
24MSH-24Sending Network AddressHD01MessageHeader.sourcestring01HD[MessageHeader.source-endpoint]We believe that if MSH-24 is vaued, although it is rarely valued, it contains better information for the MessageHeader.source.endpoint. However, one may either still want to use MSH-3 in total or a combination of content from MSH-3 and MSH-24. That is a local implementation decision to adjust the mapping accordingly.
24MSH-24Sending Network AddressHD01IF MSH-24 NOT VALUED AND MSH-3 NOT VALUEDMessageHeader.source.endpoint.extension.urluri01"http://hl7.org/fhir/R4/extension-data-absent-reason.html"
24MSH-24Sending Network AddressHD01IF MSH-24 NOT VALUED AND MSH-3 NOT VALUEDMessageHeader.source.endpoint.extension.valueCodecode01"unknown"If both MSH-3 and MSH-24 are not valued, which is valid, then the implementer needs to resolve whether to assign this a known value since they know the context, or add the data absent reason extension to provide a reason and satisfies the mandatory FHIR attribute rules. Note that the use of the data-absent-reason extension may result in a FHIR resource that is not usable by the recipient.
25MSH-25Receiving Network AddressHD01MessageHeader.destinationuri0-1HD[MessageHeader.destination-endpoint]We believe that if MSH-25 is vaued, although it is rarely valued, it contains better information for the MessageHeader.source.endpoint. However, one may either still want to use MSH-5 in total or a combination of content from MSH-5 and MSH-25. That is a local implementation decision to adjust the mapping accordingly.
25MSH-25Receiving Network AddressHD01IF MSH-25 NOT VALUED AND MSH-5 NOT VALUEDMessageHeader.destination.endpoint.extension.urluri0-1"http://hl7.org/fhir/R4/extension-data-absent-reason.html"
25MSH-25Receiving Network AddressHD01IF MSH-25 NOT VALUED AND MSH-5 NOT VALUEDMessageHeader.destination.endpoint.extension.valueCodecode0-1"unknown"
26MSH-26Security Classification TagCWE01meta.securityCoding0-1CWE[Coding]ConfidentialityClassification
27MSH-27Security Handling InstructionsCWE0-1meta.securityCoding0-1CWE[Coding]SecurityLabelHandlingInstructions
28MSH-28Special Access Restriction InstructionsST0-1

Mapping from (not specified) to (not specified)


Group 1 Mapping from unspecified code system to unspecified code system

Source Concept DetailsRelationshipTarget Concept DetailsComment
Codes from ComputableANTLRCodes from
MSH-3Sending Applicationis equivalent tosource[1]source[1]
MSH-3Sending ApplicationIF MSH-24 NOT VALUEDis equivalent tosource[1].endpointsource[1].endpointWe believe that if MSH-24 is vaued, although MSH-24 is rarely valued, it contains better information for the MessageHeader.source.endpoint than MSH-3. However, one may either still want to use MSH-3 in total or a combination of content from MSH-3 and MSH-24. That is a local implementation decision to adjust the mapping accordingly based on clear knowledge of the content. If both MSH-3 and MSH-24 are not valued, which is valid in HL7 v2, then the implementer needs to resolve how to assign MessageHeader.source as it is a required attribute. Note that a data absent reason extension could be used to provide a reason and satisfy the mandatory FHIR attribute rules. But do note that the use of the data-absent-reason extension may result in a FHIR resource that is not usable by the recipient.\
MSH-4Sending Facilityis equivalent tosender(Organization)sender(Organization)
MSH-5Receiving Applicationis equivalent todestination[1].target(Device)destination[1].target(Device)Similar as for MSH-3, MSH-5 is paired with MSH-25 and depending on local use may need to use one, the other, or a combination of both. We believe that MSH-25, when valued, provides the better information given its addition to the standard more recently.
MSH-5Receiving ApplicationIF MSH-25 VALUEDis equivalent todestination[1].namedestination[1].name
MSH-5Receiving ApplicationIF MSH-25 NOT VALUEDis equivalent todestination[1].endpointdestination[1].endpoint
MSH-6Receiving FacilityIF MSH-23 NOT VALUEDis equivalent todestination[1].receiver(Organization)destination[1].receiver(Organization)
MSH-8Securityis equivalent tometa.securitymeta.security
MSH-9Message Typeis equivalent toeventCodingeventCoding
MSH-11Processing IDis equivalent tometameta
MSH-17Country Codeis equivalent tosender(Organization.address.country)sender(Organization.address.country)
MSH-19Principal Language Of Messageis equivalent tolanguagelanguageThis does only cover the MessageHeader resource. Need to have clarity that if other resources that are part of the message that do not have Resource.meta.language valued, then it is assumed to follow MessageHeader.meta.language?? Doesn't seem RESTful, so what is the default for Resource.meta.language?
MSH-22Sending Responsible Organizationis equivalent toresponsible(Organization)responsible(Organization)
MSH-23Receiving Responsible Organizationis equivalent todestination[1].receiver(Organization)destination[1].receiver(Organization)This is an alternate representation of MSH-6. The local implementation needs to determine whech components of HD vs. XON to be used and whether it may even yield a separate Organization reference.
MSH-24Sending Network Addressis equivalent tosourcesourceWe believe that if MSH-24 is vaued, although it is rarely valued, it contains better information for the MessageHeader.source.endpoint. However, one may either still want to use MSH-3 in total or a combination of content from MSH-3 and MSH-24. That is a local implementation decision to adjust the mapping accordingly.
MSH-24Sending Network AddressIF MSH-24 NOT VALUED AND MSH-3 NOT VALUEDis equivalent tosource.endpoint.extension.urlsource.endpoint.extension.url
MSH-24Sending Network AddressIF MSH-24 NOT VALUED AND MSH-3 NOT VALUEDis equivalent tosource.endpoint.extension.valueCodesource.endpoint.extension.valueCodeIf both MSH-3 and MSH-24 are not valued, which is valid, then the implementer needs to resolve whether to assign this a known value since they know the context, or add the data absent reason extension to provide a reason and satisfies the mandatory FHIR attribute rules. Note that the use of the data-absent-reason extension may result in a FHIR resource that is not usable by the recipient.
MSH-25Receiving Network Addressis equivalent todestination[1]destination[1]We believe that if MSH-25 is vaued, although it is rarely valued, it contains better information for the MessageHeader.source.endpoint. However, one may either still want to use MSH-5 in total or a combination of content from MSH-5 and MSH-25. That is a local implementation decision to adjust the mapping accordingly.
MSH-25Receiving Network AddressIF MSH-25 NOT VALUED AND MSH-5 NOT VALUEDis equivalent todestination[1].endpoint.extension.urldestination[1].endpoint.extension.url
MSH-25Receiving Network AddressIF MSH-25 NOT VALUED AND MSH-5 NOT VALUEDis equivalent todestination[1].endpoint.extension.valueCodedestination[1].endpoint.extension.valueCode
MSH-26Security Classification Tagis equivalent tometa.security[2]meta.security[2]
MSH-27Security Handling Instructionsis equivalent tometa.security[2]meta.security[2]

Notes: