fml-model
The StructureMap resource for the FHIR Mapping Language: compile FML to a StructureMap, and print a StructureMap back as FML.
- Matches the HL7 reference compiler. The StructureMap JSON is the one
StructureMapUtilitiesin org.hl7.fhir.core builds, byte for byte, on all 1,659 maps we test against: generated rule names, the variables of the simple copy form, batch identity rules, contained ConceptMaps, documentation from comments, FHIRPath in the reference parser's canonical form. Two documented differences keep what the map says: whitespace-only strings, which the reference JSON writer drops, and calendar durations (5 days), which it rewrites as5 'days'. - Prints FML back. The printed map compiles to the same StructureMap, for every map in the corpus; it also reads maps built by older IG Publisher versions.
- R4 and R5.
to_r4writes the R4 shape (dependent.variable,defaultValue[x],contextType, ConceptMapequivalence) and reports what R4 cannot hold;from_jsonreads both. - Elements the model does not name are kept, so reading and writing a StructureMap loses nothing.
let compiled = compile; // StructureMap + diagnostics
let json = to_string_pretty?;
let r4 = to_r4; // R4 JSON + what it could not hold
let fml = print; // back to FML
Part of fml-rs. Licensed under MIT or Apache-2.0.