Expand description
Convert HL7 v2.5 messages from ER7 (pipe-delimited) encoding to the
HL7 v2.xml XML representation (urn:hl7-org:v2xml).
The ER7 encoding itself — parsing, delimiters, escape sequences — comes
from the er7 crate. This crate adds the layer above it: the HL7 v2.5
data-type tables that name XML elements, the message-structure grammars
that group segments, and the XML renderer. See spec/index.md for the
exact conversion rules (source of truth).
let er7 = "MSH|^~\\&|hphis||EPIC||20131011093851||ORM^O01|14AAACVDD|P|2.5\r\
PID|1||241900||MEDIANO^FOUAZ\r\
ORC|NW|ORD1";
let xml = hl7_2_from_er7_into_xml::convert(er7).unwrap();
assert!(xml.contains("<ORM_O01 xmlns=\"urn:hl7-org:v2xml\">"));
assert!(xml.contains("<XPN.1>"));Re-exports§
pub use er7;
Modules§
- structure
- Arranging a message’s segments into the groups its structure defines.
- xml
- Building the v2.xml element tree from parsed segments, and serializing it.
Structs§
- Options
- Options controlling how a message is converted; see
convert_with_options.
Enums§
- Hl7Error
- Errors that can occur while turning ER7 text into a
er7::Messageor, in turn, into v2.xml.
Functions§
- convert
- Convert one ER7 message to a v2.xml document with default options.
- convert_
with_ dictionary - Convert one ER7 message to a v2.xml document against a given dictionary.
- convert_
with_ options - Convert one ER7 message to a v2.xml document, using the bundled HL7 v2.5 dictionary.
- split_
messages - Split input that may hold several messages (or an HL7 batch file) into individual ER7 messages, one per MSH segment. Batch envelope segments (FHS, BHS, BTS, FTS) are dropped.