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§
- Concept
MapSet - A fixed set of ConceptMaps (FHIR R4 or R5 JSON), found by
url,url|version, and by the canonical URLs they replace (relatedArtifactof typepredecessor), so maps that still use an old canonical find the renamed ConceptMap. - Debug
Report - What a
$transformwithdebug=truereports. - 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::Limiterror, 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. - NoConcept
Maps - No ConceptMaps besides those contained in the map.
- NoExpressions
- No FHIRPath: maps that use expressions fail with a clear error.
- NoMaps
- No imported maps.
- Random
Ids - Random (version 4) UUIDs.
- Sequential
Ids - UUIDs counting up from zero (
00000000-0000-0000-0000-000000000001, …), for tests and repeatable runs. - Trace
- The recorded events of a transform.
- Trace
Event - One evaluation unit.
- Trace
Variable - 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§
- Error
Kind - Why a transform failed.
- Phase
- Trace
Status
Traits§
- Concept
MapResolver - 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. - Translate
Service - 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.answerwith a variableitembecomes%item.answer. - debug_
parameters - The
Parametersresponse of$transformwithdebug=true(debug.md):returnwhen there is a result,traceStatus, thetraceevents with their text positions wherespansknows them, and anoutcomewith 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(fromsystem, 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 isrelated-to,equivalentorsource-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, R4provided).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§
- Span
Lookup - 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 fromfml_model::Locations. - Translate
Future - A future a
TranslateServicereturns.