Skip to main content
Version: v0.0.4

Interface: XPN

HL7 v2 Extended Person Name (XPN): structured name per HL7 Chapter 2. All 14 components are optional. Fields are OMITTED when the underlying component is absent (exactOptionalPropertyTypes).

Component positions (HL7 1-indexed; this interface is 0-indexed by key):

  1. familyName
  2. givenName
  3. secondName (or "second and further given names")
  4. suffix (e.g. Jr., III)
  5. prefix (e.g. Dr., Mrs.)
  6. degree (e.g. MD, PhD)
  7. nameTypeCode (L=Legal, M=Maiden, N=Nickname, S=Coded Pseudo-Name, ...)
  8. nameRepresentationCode
  9. nameContext (flattened to string in v1: CWE nesting is out of scope)
  10. nameValidityRange
  11. nameAssemblyOrder (F=family first, G=given first)
  12. effectiveDate (raw HL7 TS string: caller may parse via parseDtm)
  13. expirationDate
  14. professionalSuffix

Example

import type { XPN } from "@cosyte/hl7";
const name: XPN = { familyName: "Smith", givenName: "Jane", prefix: "Mrs." };

Properties

degree?

readonly optional degree?: string


effectiveDate?

readonly optional effectiveDate?: string


expirationDate?

readonly optional expirationDate?: string


familyName?

readonly optional familyName?: string


givenName?

readonly optional givenName?: string


nameAssemblyOrder?

readonly optional nameAssemblyOrder?: string


nameContext?

readonly optional nameContext?: string


nameRepresentationCode?

readonly optional nameRepresentationCode?: string


nameTypeCode?

readonly optional nameTypeCode?: string


nameValidityRange?

readonly optional nameValidityRange?: string


prefix?

readonly optional prefix?: string


professionalSuffix?

readonly optional professionalSuffix?: string


secondName?

readonly optional secondName?: string


suffix?

readonly optional suffix?: string