Data type HD in FHIR

How the components of data type HD (Hierarchic Designator) become FHIR R4 elements, from the HL7 Version 2 to FHIR guide.

HL7 v2 definition
Definition of HD in HL7 v2 2.8
Maps
MessageHeaderDestination (Endpoint)MessageHeaderSource (Endpoint)MessageHeaderDestination (Name)MessageHeaderSource (Name)DeviceIdentifierLocationOrganizationUri

To MessageHeaderDestinationEndpoint6 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISnamestring
HD.2Universal Id
STendpointuri
If IF HD-3 = "ISO"Value "urn:oid:"+HD.2
HD.2Universal Id
STendpointuri
If IF HD-3 = "UUID"Value "urn:uuid:"+HD.2
HD.2Universal Id
STendpointuri
If IF HD-3 NOT IN ("ISO", "UUID")
HD.3Universal Id Type
STendpoint.extension.urluri
If IF NOT VALUEDValue "http://hl7.org/fhir/StructureDefinition/data-absent-reason"
HD.3Universal Id Type
STendpoint.extension.valueCodecode
If IF NOT VALUEDValue "unknown"

To MessageHeaderSourceEndpoint8 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISnamestring
If IF HD.2 NOT VALUED AND (HD-3 NOT IN ("ISO", "UUID", "DNS", "URI"))
HD.2Universal Id
STendpointuri
If IF HD-3 = "ISO"Value "urn:oid:"+HD.2
HD.2Universal Id
STendpointuri
If IF HD-3 = "UUID"Value "urn:uuid:"+HD.2
HD.2Universal Id
STendpointuri
If IF HD-3 = "DNS"Value "urn:dns:"+HD.2
HD.2Universal Id
STendpointuri
If IF HD-3 = "URI"Value "urn:uri:"+HD.2
HD.2Universal Id
STname
If IF HD-3 NOT IN ("ISO", "UUID", "DNS", "URI")Value HD.1+" - "+HD.3+":"+HD.2
HD.3Universal Id Type
STendpoint.extension[1].url
If IF NOT VALUED OR NOT IN ("ISO", "UUID", "DNS", "URI")Value "http://hl7.org/fhir/R4/extension-data-absent-reason.html"
HD.3Universal Id Type
STendpoint.extension[1].valueCode
If IF NOT VALUED OR NOT IN ("ISO", "UUID", "DNS", "URI")Value "unknown"

To MessageHeaderDestinationName1 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.2Universal Id
STnamestring

To MessageHeaderSourceName2 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISnamestring
HD.2Universal Id
STsoftwarestring

To Device4 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISidentifier[1].valuestring
HD.2Universal Id
STidentifier[2].valuestring
HD.3Universal Id Type
IDidentifier[2].typeCodeableConcept
Code map v2-0301
HD.3Universal Id Type
IDidentifier[2].systemuri
If IF HD.3 IN ("ISO", "UUID")Value "urn:ietf:rfc:3986"

To Identifier3 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISvalue[1]string
HD.2Universal Id
STvalue[2]string
HD.3Universal Id Type
IDtype[2]CodeableConcept

To Location4 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISnamestring
HD.2Universal Id
STidentifier.valuestring
If IF HD.3 IN ("ISO", "UUID")
HD.2Universal Id
STphysicalType.coding.codecode
Value "si"
HD.2Universal Id
STphysicalType.coding.systemuri
Value "http://terminology.hl7.org/CodeSystem/location-physical-type"

To Organization4 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
ISidentifier[1].valuestring
HD.2Universal Id
STidentifier[2].valuestring
HD.3Universal Id Type
IDidentifier[2].typeCodeableConcept
Code map v2-0301
HD.3Universal Id Type
IDidentifier[2].systemuri
If IF HD.3 IN ("ISO", "UUID")Value "urn:ietf:rfc:3986"

To Uri4 rows

HL7 v2 sourcev2 typeFHIR elementFHIR typeConditions and notes
HD.1Namespace Id
IS$valueurl
HD.2Universal Id
ST$valueurl
If IF HD.1 NOT VALUED AND IF HD-3 = "ISO"Value "urn:oid:"+HD.2
HD.2Universal Id
ST$valueurl
If IF HD.1 NOT VALUED AND IF HD-3 = "UUID"Value "urn:uuid:"+HD.2
HD.2Universal Id
ST$valueurl
If IF HD.1 NOT VALUED AND IF HD-3 NOT IN ("ISO", "UUID")