Money or Percentage (MOP) -- HL7v2 composite data type.
Transmits a monetary amount or a percentage.
2 components:
- Money or Percentage Indicator (ID) -- AT (amount), PC (percentage)
- Money or Percentage Quantity (NM)
Summary
Types
Functions
Encodes a MOP to a list of component strings.
Examples
iex> HL7v2.Type.MOP.encode(%HL7v2.Type.MOP{money_or_percentage_indicator: "AT", money_or_percentage_quantity: "150.00"})
["AT", "150.00"]
iex> HL7v2.Type.MOP.encode(%HL7v2.Type.MOP{money_or_percentage_indicator: "PC"})
["PC"]
iex> HL7v2.Type.MOP.encode(nil)
[]
Parses a MOP from a list of components.
Examples
iex> HL7v2.Type.MOP.parse(["AT", "150.00"])
%HL7v2.Type.MOP{money_or_percentage_indicator: "AT", money_or_percentage_quantity: "150.00"}
iex> HL7v2.Type.MOP.parse(["PC", "80"])
%HL7v2.Type.MOP{money_or_percentage_indicator: "PC", money_or_percentage_quantity: "80"}
iex> HL7v2.Type.MOP.parse([])
%HL7v2.Type.MOP{}