Address (AD) -- HL7v2 composite data type.
A simpler address type used in older HL7 versions. Superseded by XAD in v2.3+.
8 components:
- Street Address (ST)
- Other Designation (ST)
- City (ST)
- State or Province (ST)
- Zip or Postal Code (ST)
- Country (ID) -- Table 0399
- Address Type (ID) -- Table 0190
- Other Geographic Designation (ST)
Summary
Types
Functions
Encodes an AD to a list of component strings.
Examples
iex> HL7v2.Type.AD.encode(%HL7v2.Type.AD{street_address: "123 Main St", city: "Springfield", state_or_province: "IL"})
["123 Main St", "", "Springfield", "IL"]
iex> HL7v2.Type.AD.encode(nil)
[]
Parses an AD from a list of components.
Examples
iex> HL7v2.Type.AD.parse(["123 Main St", "Suite 100", "Springfield", "IL", "62704", "USA"])
%HL7v2.Type.AD{street_address: "123 Main St", other_designation: "Suite 100", city: "Springfield", state_or_province: "IL", zip_or_postal_code: "62704", country: "USA"}
iex> HL7v2.Type.AD.parse(["456 Oak Ave"])
%HL7v2.Type.AD{street_address: "456 Oak Ave"}
iex> HL7v2.Type.AD.parse([])
%HL7v2.Type.AD{}