Extended Address (XAD) -- HL7v2 composite data type.
14 components:
- Street Address (SAD) -- sub-components delimited by
& - Other Designation (ST)
- City (ST)
- State or Province (ST)
- Zip or Postal Code (ST)
- Country (ID) -- Table 0399, ISO 3166-1
- Address Type (ID) -- Table 0190: H=Home, B=Business, M=Mailing, etc.
- Other Geographic Designation (ST)
- County/Parish Code (IS) -- Table 0289
- Census Tract (IS) -- Table 0288
- Address Representation Code (ID) -- Table 0465
- Address Validity Range (DR) -- deprecated, sub-components delimited by
& - Effective Date (TS) -- sub-components delimited by
& - Expiration Date (TS) -- sub-components delimited by
&
Summary
Types
@type t() :: %HL7v2.Type.XAD{ address_representation_code: binary() | nil, address_type: binary() | nil, address_validity_range: HL7v2.Type.DR.t() | nil, census_tract: binary() | nil, city: binary() | nil, country: binary() | nil, county_code: binary() | nil, effective_date: HL7v2.Type.TS.t() | nil, expiration_date: HL7v2.Type.TS.t() | nil, other_designation: binary() | nil, other_geographic: binary() | nil, state: binary() | nil, street_address: HL7v2.Type.SAD.t() | nil, zip: binary() | nil }
Functions
Encodes an XAD to a list of component strings.
Examples
iex> HL7v2.Type.XAD.encode(%HL7v2.Type.XAD{
...> street_address: %HL7v2.Type.SAD{street_or_mailing_address: "123 Main St"},
...> city: "Springfield",
...> state: "IL",
...> zip: "62704"
...> })
["123 Main St", "", "Springfield", "IL", "62704"]
iex> HL7v2.Type.XAD.encode(nil)
[]
Parses an XAD from a list of components.
Examples
iex> HL7v2.Type.XAD.parse(["123 Main St&Main St&123", "", "Springfield", "IL", "62704", "USA", "H"])
%HL7v2.Type.XAD{
street_address: %HL7v2.Type.SAD{street_or_mailing_address: "123 Main St", street_name: "Main St", dwelling_number: "123"},
city: "Springfield",
state: "IL",
zip: "62704",
country: "USA",
address_type: "H"
}
iex> HL7v2.Type.XAD.parse([])
%HL7v2.Type.XAD{}