ferrobridge_hl7v2/lib.rs
1// SPDX-FileCopyrightText: Cadasto B.V.
2// SPDX-License-Identifier: BUSL-1.1
3
4//! The FerroBRIDGE HL7 v2 face: MLLP framing, MSH-18 decoding, positional
5//! parsing, the acknowledgment, and the v2-to-FHIR `ConceptMap` interpreter.
6//!
7//! A message arrives as one MLLP frame ([`mllp`]), is decoded from the
8//! character set its MSH-18 names ([`decode`]), split by position and grouped
9//! by the message structure the generated `hl7v2-types` tables define
10//! ([`parse`]), and answered with an original-mode acknowledgment ([`ack`]);
11//! [`inbound`] runs those steps and settles the `AR` and `AE` answers a
12//! message owes before it is mapped. [`write`](mod@write) composes any
13//! message, a reply or an originated one, checked against its structure.
14//! [`batch`] splits an HL7 batch file into its messages and builds the
15//! response batch that acknowledges them.
16//! [`map`] runs the `ConceptMaps` of the HL7 v2-to-FHIR implementation guide
17//! over the parsed message and writes an R4 message `Bundle` through the
18//! `fhirconnect` path model.
19//!
20//! Every segment, field or component the run does not carry, and every
21//! condition or target form it cannot evaluate, is a typed outcome on the
22//! result, counted and never dropped.
23#![doc(test(attr(deny(warnings))))]
24
25pub mod ack;
26pub mod batch;
27pub mod decode;
28pub mod inbound;
29#[cfg(feature = "map")]
30pub mod map;
31pub mod mllp;
32pub mod parse;
33pub mod write;
34
35/// The HL7 v2 version the generated definitions are derived from.
36///
37/// The `hl7v2-types` tables are generated from `HL7/v2ig`, whose definitions
38/// are extracted from HL7 V2.9.1; a message of an earlier 2.x version is
39/// parsed against them through the standard's backward compatibility.
40pub const DEFINITIONS_VERSION: &str = "2.9.1";