HL7v2.Type.RMC (HL7v2 v3.10.1)

Copy Markdown View Source

Room Coverage (RMC) -- HL7v2 composite data type.

Specifies room coverage type, amount, and percentage for insurance.

4 components:

  1. Room Type (IS) -- Table 0145: e.g., "PR" (private), "SP" (semi-private)
  2. Amount Type (IS) -- Table 0146: e.g., "LM" (limit), "PC" (percentage), "UP" (unlimited)
  3. Coverage Amount (NM) -- the numeric coverage value
  4. Money or Percentage (MOP) -- v2.5.1 added; rarely populated, treated as ST

Summary

Functions

Encodes an RMC to a list of component strings.

Parses an RMC from a list of components.

Types

t()

@type t() :: %HL7v2.Type.RMC{
  amount_type: binary() | nil,
  coverage_amount: HL7v2.Type.NM.t() | nil,
  money_or_percentage: binary() | nil,
  room_type: binary() | nil
}

Functions

encode(rmc)

@spec encode(t() | nil) :: list()

Encodes an RMC to a list of component strings.

Examples

iex> HL7v2.Type.RMC.encode(%HL7v2.Type.RMC{room_type: "PR", amount_type: "LM", coverage_amount: %HL7v2.Type.NM{value: "500", original: "500"}})
["PR", "LM", "500"]

iex> HL7v2.Type.RMC.encode(nil)
[]

parse(components)

@spec parse(list()) :: t()

Parses an RMC from a list of components.

Examples

iex> HL7v2.Type.RMC.parse(["PR", "LM", "500"])
%HL7v2.Type.RMC{room_type: "PR", amount_type: "LM", coverage_amount: %HL7v2.Type.NM{value: "500", original: "500"}}

iex> HL7v2.Type.RMC.parse([])
%HL7v2.Type.RMC{}