Money (MO) -- HL7v2 composite data type.
Used for monetary amounts with optional denomination.
2 components:
- Quantity (NM)
- Denomination (ID) -- ISO 4217 currency code (e.g., USD, EUR)
Summary
Types
Functions
Encodes an MO to a list of component strings.
Examples
iex> HL7v2.Type.MO.encode(%HL7v2.Type.MO{quantity: "150.00", denomination: "USD"})
["150.00", "USD"]
iex> HL7v2.Type.MO.encode(%HL7v2.Type.MO{quantity: "250"})
["250"]
iex> HL7v2.Type.MO.encode(nil)
[]
Parses an MO from a list of components.
Examples
iex> HL7v2.Type.MO.parse(["150.00", "USD"])
%HL7v2.Type.MO{quantity: "150.00", denomination: "USD"}
iex> HL7v2.Type.MO.parse(["250"])
%HL7v2.Type.MO{quantity: "250"}
iex> HL7v2.Type.MO.parse([])
%HL7v2.Type.MO{}