ferrobridge_term/lib.rs
1// SPDX-FileCopyrightText: Cadasto B.V.
2// SPDX-License-Identifier: BUSL-1.1
3
4//! The FerroBRIDGE FHIR terminology client for `$lookup`, `$translate` and
5//! `$validate-code`.
6//!
7//! Three operations on one configured server: [`client::Client::lookup`] resolves a
8//! code's display, [`client::Client::translate`] maps a code into another system, and
9//! [`client::Client::validate_code`] tests membership of a value set.
10//! [`client::Client::batch`] sends several of them as one `batch` `Bundle` and answers
11//! them by position.
12//!
13//! A negative answer an operation states in its own `out` parameters is an
14//! outcome ([`outcome`]); an answer the server refused is a typed error
15//! carrying the upstream status, the body, and any `tx-issue-type` coding the
16//! `OperationOutcome` holds. A missing display is
17//! [`LookupOutcome::NotFound`](outcome::LookupOutcome::NotFound), never an
18//! empty string.
19//!
20//! The request and response contracts come from the generated `fhir-types`
21//! operation modules; this crate models no FHIR of its own. The release is
22//! configured ([`WireVersion`](config::WireVersion)) because a server that
23//! serves several releases side by side puts the release in the base path.
24#![doc(test(attr(deny(warnings))))]
25
26pub mod client;
27pub mod concept;
28pub mod config;
29mod decode;
30pub mod error;
31pub mod outcome;
32mod wire;
33
34/// The HL7 FHIR release this crate targets.
35///
36/// The release is published at <https://hl7.org/fhir/R4/>. STU3 and R4B are
37/// accepted on the wire as well ([`WireVersion`](config::WireVersion)).
38pub const FHIR_VERSION: &str = "R4";
39
40/// `CodeSystem/$lookup`, as the operation is invoked
41/// (<https://hl7.org/fhir/R4/codesystem-operation-lookup.html>).
42pub const LOOKUP: &str = "CodeSystem/$lookup";
43
44/// `ConceptMap/$translate`
45/// (<https://hl7.org/fhir/R4/conceptmap-operation-translate.html>).
46pub const TRANSLATE: &str = "ConceptMap/$translate";
47
48/// `ValueSet/$validate-code`
49/// (<https://hl7.org/fhir/R4/valueset-operation-validate-code.html>).
50pub const VALIDATE_CODE: &str = "ValueSet/$validate-code";
51
52/// The batch interaction, a `POST` of a `Bundle` to the service base
53/// (<https://hl7.org/fhir/R4/http.html#transaction>).
54pub const BATCH: &str = "batch";