Reference Pointer (RP) -- HL7v2 composite data type.
Points to data stored externally to the message. Common in OBX-5 when value_type is "RP".
4 components:
- Pointer (ST) -- reference to external data (e.g., URL, file path)
- Application ID (HD) -- sub-components delimited by
& - Type of Data (ID) -- Table 0191: e.g., "Application", "Audio", "Image", "TEXT"
- Subtype (ID) -- Table 0291: e.g., "PDF", "JPEG", "DICOM"
Summary
Types
@type t() :: %HL7v2.Type.RP{ application_id: HL7v2.Type.HD.t() | nil, pointer: binary() | nil, subtype: binary() | nil, type_of_data: binary() | nil }
Functions
Encodes an RP to a list of component strings.
Examples
iex> HL7v2.Type.RP.encode(%HL7v2.Type.RP{
...> pointer: "/reports/12345.pdf",
...> application_id: %HL7v2.Type.HD{namespace_id: "LAB", universal_id: "1.2.3", universal_id_type: "ISO"},
...> type_of_data: "Application",
...> subtype: "PDF"
...> })
["/reports/12345.pdf", "LAB&1.2.3&ISO", "Application", "PDF"]
iex> HL7v2.Type.RP.encode(%HL7v2.Type.RP{pointer: "/image.jpg"})
["/image.jpg"]
iex> HL7v2.Type.RP.encode(nil)
[]
Parses an RP from a list of components.
Examples
iex> HL7v2.Type.RP.parse(["/reports/12345.pdf", "LAB&1.2.3&ISO", "Application", "PDF"])
%HL7v2.Type.RP{
pointer: "/reports/12345.pdf",
application_id: %HL7v2.Type.HD{namespace_id: "LAB", universal_id: "1.2.3", universal_id_type: "ISO"},
type_of_data: "Application",
subtype: "PDF"
}
iex> HL7v2.Type.RP.parse(["http://example.com/image.jpg"])
%HL7v2.Type.RP{pointer: "http://example.com/image.jpg"}
iex> HL7v2.Type.RP.parse([])
%HL7v2.Type.RP{}