HL7.Message.new
You're seeing just the function
new
, go back to HL7.Message module for more information.
Specs
new(content_hl7() | HL7.Header.t()) :: t() | HL7.InvalidMessage.t()
Creates an HL7.Message
struct containing parsed segment list data. It will
also expose basic header information (e.g. encoding characters, message type) for routing.
Invalid MSH formats will return an HL7.InvalidMessage
.
Examples
iex> HL7.Examples.wikipedia_sample_hl7()
...> |> HL7.Message.new()
...> |> HL7.Query.get_segment_names()
["MSH", "EVN", "PID", "PV1", "OBX", "OBX", "AL1", "DG1"]
iex> HL7.Message.new(
...> "MSH|^~\\&|MegaReg|XYZHospC|SuperOE|XYZImgCtr|" <>
...> "20060529090131-0500||ADT^A01^ADT_A01|01052901|P|2.5")
...> |> HL7.Query.get_segment_names()
["MSH"]
iex> HL7.Message.new(
...> [["MSH", "|", "^~\\&", "App", "Facility", "", "",
...> "20060529090131-0500", "", [["ADT", "A01", "ADT_A01"]],
...> "01052901", "P", "2.5"]])
...> |> HL7.Query.get_segment_names()
["MSH"]