1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-License-Identifier: BUSL-1.1
//! The two FHIRconnect operations, `$tofhir` and `$toopenehr`.
//!
//! The FHIRconnect REST API chapter defines one operation per mapping
//! direction, both `POST` against the service base, both pure
//! transformations, and both following the FHIR R4 operations framework
//! (<https://hl7.org/fhir/R4/operations.html>). The chapter is
//! `engine/rest-api.adoc` with its FSH operation definitions under `rest/`,
//! vendored under `docs/specs/fhirconnect/` at the pinned specification
//! commit; every wire shape here is read from that text.
//!
//! The parts are separate modules:
//!
//! - [`contract`] is the typed request and response of each operation, with
//! the `Parameters` reader and writer the framework asks for.
//! - [`programs`] is the compiled set one call selects from.
//! - [`run`] runs the engine behind each operation.
//! - [`provenance`] builds the `Provenance` every `$tofhir` run carries.
//! - [`issues`] renders the engine's declared losses as `OperationOutcome`
//! issues.
//! - [`error`] is the typed refusal, with the R4 issue code each one renders
//! as.
//!
//! Where the chapter leaves room, FerroBRIDGE pins its own answer and says so:
//! strictness is the default, so a failed mapping answers an
//! `OperationOutcome` and no Bundle or composition; the Bundle type is
//! `collection`; and a Bundle that references more than one subject is a
//! refusal, because one Bundle maps to one composition.
/// The `$tofhir` operation code, without the `$`.
///
/// `ToFhir.fsh` declares `code = #tofhir` at the system level.
pub const TO_FHIR: &str = "tofhir";
/// The `$toopenehr` operation code, without the `$`.
///
/// `ToOpenEhr.fsh` declares `code = #toopenehr` at the system level.
pub const TO_OPENEHR: &str = "toopenehr";
/// The media type the chapter defines for an openEHR payload.
///
/// "This specification defines the media type `application/openehr+json` to
/// identify a payload as openEHR canonical JSON", with the suffix ordering of
/// RFC 6839 ยง4 (<https://www.rfc-editor.org/rfc/rfc6839#section-4>).
pub const OPENEHR_JSON: &str = "application/openehr+json";