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.
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).
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.
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§

Phase
TraceStatus

Traits§

ConceptMapResolver
Finds ConceptMaps by canonical URL, for translate(value, 'url', output).
Expressions
Evaluates FHIRPath expressions.
MapResolver
Finds the maps a map imports, by canonical URL or * pattern.

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: return (when there is a result), traceStatus, the trace events and, on failure, an outcome.
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.