rusthl7/
lib.rs

1/*!
2
3# RustHl7 - A HL7 V2 message parser and library
4
5This crate is attempting to provide the tooling for a fully spec-compliant HL7 V2 message parser.  Note that _interpreting_ the parsed message elements into a strongly
6typed segment/message format is specifically **out of scope** as there's simply too many variants over too many versions for me to go there (maybe
7someone else could code-gen a crate using this this crate to provide the source information?).
8
9This crate tries to provide the tools to build HL7 systems without dictating _how_ to build your system, there's no such thing as one-size-fits all in healthcare!
10
11*/
12
13pub mod escape_sequence;
14pub mod fields;
15pub mod message;
16pub mod segments;
17pub mod separators;
18
19#[derive(Debug, thiserror::Error)]
20pub enum Hl7ParseError {
21    #[error("Unexpected error: {0}")]
22    Generic(String),
23
24    #[error("Failure parsing MSH1/MSH2 while discovering separator chars: {0}")]
25    Msh1Msh2(String),
26
27    #[error("Required value missing")]
28    MissingRequiredValue(),
29}