Smile CDR v2024.05.PRE
On this page:

27.12.1Naming System Mapping

 

One challenging area when mapping between HL7 v2.x and HL7 FHIR is around the use of identifiers.

The FHIR Identifier datatype generally consists of an identifier and a system. For example, consider the following identifier for a Patient:

{
    "system": "http://example.com",
    "value": "12345"
}

In HL7 v2.x, identifiers are often represented in datatypes such as the CX (composite identifier) datatype.

The v2.x CX datatype has several key differences in functionality and common usage from the FHIR Identifier datatype:

  • The concept of an identifier "system" in FHIR overlaps with several concepts in HL7 v2.x, including the "Assigning Authority" and the "Assigning Jurisdiction". For example, the FHIR system http://hl7.org/fhir/sid/us-ssn (US Social Security Number) implies an Assigning Authority of the Social Security Administration and an Assigning Jurisdiction of USA. As a result, there is no need for these two separate concepts to be represented within a FHIR identifier even though they are typically represented in an HL7 v2.x ID.

  • FHIR uses URIs wherever possible to represent systems in a way that provides meaning to humans as well as to computers (e.g. http://example.com/mrn). In HL7 v2.x it is common to represent IDs as simple mnemonics (e.g. EXMPLMRN).

27.12.2Default Mappings

 

By default, when converting a FHIR Identifier to an HL7 v2.x CX, the following mappings are applied:

FHIR Identifier v2.x CX v2.x XCN Notes
Identifier.system CX.4 (Assigning Authority) XCN.9 (Assigning Authority)
Identifier.value CX.1 (ID Number) XCN.1 (ID Number)
Identifier.type.coding.code CX.5 (Identifier Type) XCN.13 (Identifier Type) When mapping to FHIR, the Identifier.type.coding.system is set to http://hl7.org/fhir/v2/0203.
When mapping from FHIR, only the Identifier.type.coding repetition with that system is mapped.

27.12.3Using NamingSystem for Mapping Identifiers

 

When using the HL7 v2.x Sending Endpoint module, the map_identifiers_using_namingsystem property may be used to enable the use of NamingSystem resources to convert FHIR Identifier.system values into HL7 v2.x identifiers.

When using this mode, for every Identifier.system value being converted, a search is performed for the NamingSystem resource where NamingSystem.uniqueId.value matches the given system.

If a match is found, the following fields are mapped:

NamingSystem field v2.x CX v2.x XCN Notes
NamingSystem.uniqueId.value CX.4 (Assigning Authority) XCN.9 (Assigning Authority) Only the first repetition of NamingSystem.uniqueId where NamingSystem.uniqueId.type = other is mapped.
NamingSystem.assigningJurisdiction CX.9 (Assigning Jurisdiction) XCN.22 (Assigning Jurisdiction)
NamingSystem.type CX.5 (Identifier Type) XCN.13 (Identifier Type)

When using the HL7 v2.x Listening Endpoint module, the map_identifiers_using_namingsystem_inbound property may be used to enable the use of NamingSystem resources to convert HL7 v2.x identifiers into FHIR Identifier.system values.

When using this mode, for every HL7 v2.x identifier value being converted, a search is performed for the NamingSystem resource where NamingSystem.uniqueId.value matches the given system.

If a match is found, the following fields are mapped:

NamingSystem field v2.x CX v2.x XCN Notes
NamingSystem.uniqueId.value CX.4 (Assigning Authority) XCN.9 (Assigning Authority) Only the first repetition of NamingSystem.uniqueId where NamingSystem.uniqueId.type = uri is mapped.

27.12.3.1Example

The following example shows a NamingSystem resource

{
  "resourceType": "NamingSystem",
  "type": {
    "coding": [
      {
        "system": "http://hl7.org/fhir/v2/0203",
        "code": "MR",
        "display": "Medical Record Number"
      }
    ]
  },
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "US",
          "display": "United States of America (the)"
        }
      ]
    }
  ],
  "uniqueId": [
    {
      "type": "uri",
      "value": "http://example.com/mrns"
    },
    {
      "type": "other",
      "value": "EXMPL-IDS"
    }
  ]
}

This example could result is an identifier such as the following value in PID.3. PID|||12345^^^EXMPL-IDS^MR^^^^US&United States of America (the)&urn:iso:std:iso:3166