Skip to main content

Crate fml_engine

Crate fml_engine 

Source
Expand description

StructureMap engine for the FHIR Mapping Language.

Runs a StructureMap over FHIR JSON, as the HL7 reference engine does. Structure definitions come from fml_check::Definitions; FHIRPath from an Expressions implementation, such as the one the fhirpath feature provides; imported maps from a MapResolver.

Structs§

ConceptMapSet
A fixed set of ConceptMaps (FHIR R4 or R5 JSON), found by url, url|version, and by the canonical URLs they replace (relatedArtifact of type predecessor), so maps that still use an old canonical find the renamed ConceptMap.
DebugReport
What a $transform with debug=true reports.
Engine
Runs StructureMaps.
Error
A failed transform.
Item
A value passed to or returned by FHIRPath: FHIR JSON and its FHIR type where known (Patient, HumanName, string).
Limits
How much a transform may do before it stops with an ErrorKind::Limit error, and how much of its trace is kept.
MapSet
A fixed set of maps, matched by URL; * in an import matches any run of characters.
NoConceptMaps
No ConceptMaps besides those contained in the map.
NoExpressions
No FHIRPath: maps that use expressions fail with a clear error.
NoMaps
No imported maps.
RandomIds
Random (version 4) UUIDs.
SequentialIds
UUIDs counting up from zero (00000000-0000-0000-0000-000000000001, …), for tests and repeatable runs.
Trace
The recorded events of a transform.
TraceEvent
One evaluation unit.
TraceVariable
One variable binding at an event.
Transformed
The result of a transform.
Translation
The result of translating a code: the target system and the mapped target entry.

Enums§

ErrorKind
Why a transform failed.
Phase
TraceStatus

Traits§

ConceptMapResolver
Finds ConceptMaps by canonical URL, for translate(value, 'url', output).
Expressions
Evaluates FHIRPath expressions.
IdGenerator
Makes the UUIDs a transform needs.
MapResolver
Finds the maps a map imports, by canonical URL or * pattern.
TranslateService
A terminology service that runs ConceptMap/$translate (transforms.md, “translate”), for the ConceptMaps the engine does not hold itself: a FHIR server’s own ConceptMaps, or an external terminology server.

Functions§

bind_variables
Rewrites the map’s variables to FHIRPath environment variables: in a StructureMap, a name that is a variable refers to it (the reference engine resolves such names before the focus), so item.answer with a variable item becomes %item.answer.
debug_parameters
The Parameters response of $transform with debug=true (debug.md): return when there is a result, traceStatus, the trace events with their text positions where spans knows them, and an outcome with the failure, the reason events were left out, and values left out of the result.
no_spans
No text positions: maps that were not compiled from FML here.
translate
Translates code (from system, when known) with a ConceptMap in R5 or R4 form, as the reference engine does: the first element for the code, and among its targets the one whose relationship is related-to, equivalent or source-is-narrower-than-target (or none); several such targets are ambiguous. Without an element for the code, the group’s unmapped rule applies (use-source-code, fixed, R4 provided). Ok(None): the ConceptMap does not know the code, and the reference engine leaves the target unset. An element whose targets are all unrelated is an error.

Type Aliases§

SpanLookup
Where a part of a map is in its FML text: the map’s canonical URL (the trace’s source) and the part’s location (StructureMap.group[0].rule[1]). For maps compiled from FML, this comes from fml_model::Locations.
TranslateFuture
A future a TranslateService returns.