In hl7 messages the HD DataType consists of NameSpaceID, UniversalID and UniversalID Type. What do these different entities specify and how are they used? I mainly want to know what is NamespaceID in scope of an organization and when is it used?
1 Answers
HD
is most commonly used as part of other data types like CX
(Patient IDs, for example) or XCN
(Provider name + ID). Usually it gets labeled as "Assigning Authority" or "Assigning Facility".
The best example I can think of is a Provider's NPI number. NPI is issued by CMS/NPPES, so that is what the HD data type is trying to encode. The Namespace ID, might just be NPI
, or whatever two parties agree upon to use to identify that the number is an NPI number. NPI has an OID as well. So any of the following would be valid HD uses:
Just namespace ID:
NPI
All three:
NPI&2.16.840.1.113883.4.6&ISO
Just the Universal parts:
&2.16.840.1.113883.4.6&ISO
Or some other local code instead of the ISO code:
&NPI&HEALTHSYSTEM123
Part of the reason that there is a Namespace ID at all is for backwards compatibility reasons. It's probably best to send all three if you can, but expect most systems to only look at and process the namespace ID.
From Chapter 2.A.33 of the HL7v2.7 spec:
The HD is designed to be a more powerful and more general replacement for the application identifier of HL7 versions 2.1 and 2.2. It adds two additional components, the and the to the former application ID (which is renamed more generically to be the namespace ID).

- 357
- 1
- 7