FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

FHIR Cross-Version Mapping Pack, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cross-version/ and changes regularly. See the Directory of published versions

StructureMap: ElementDefinition Transforms: R2 to R3

Official URL: http://hl7.org/fhir/StructureMap/ElementDefinition2to3 Version: 0.1.0
Standards status: Draft Maturity Level: 1 Computable Name: ElementDefinition2to3

ElementDefinitionTransformsR2toR3

/// url = 'http://hl7.org/fhir/StructureMap/ElementDefinition2to3'
/// name = 'ElementDefinition2to3'
/// title = 'ElementDefinition Transforms: R2 to R3'
/// status = 'active'

uses "http://hl7.org/fhir/1.0/ElementDefinition" alias ElementDefinitionR2 as source
uses "http://hl7.org/fhir/3.0/ElementDefinition" alias ElementDefinition as target

imports "http://hl7.org/fhir/StructureMap/*2to3"

group ElementDefinition(source src : ElementDefinitionR2, target tgt : ElementDefinition, target first : boolean) <<type+>> {
  src.extension -> tgt.extension "ElementDefinition-extensions";
  src.path -> tgt.id "ElementDefinition-id";
  src.path -> tgt.path "ElementDefinition-path";
  src.representation -> tgt.representation "ElementDefinition-representation";
  src.name -> tgt.sliceName "ElementDefinition-sliceName";
  src.name -> tgt.id "ElementDefinition-id";
  src.label -> tgt.label "ElementDefinition-label";
  src.code -> tgt.code "ElementDefinition-code";
  src.slicing as vs0 -> tgt.slicing as vt0 then {
    vs0.discriminator as vs1 ->  vt0.discriminator as vd1,  vd1.type = 'value',  vd1.path = vs1 "slicing-discriminator";
    vs0.description -> vt0.description "slicing-description";
    vs0.ordered -> vt0.ordered "slicing-ordered";
    vs0.rules -> vt0.rules "slicing-rules";
  } "ElementDefinition-slicing";
  src.short -> tgt.short "ElementDefinition-short";
  src.definition -> tgt.definition "ElementDefinition-definition";
  src.comments -> tgt.comment "ElementDefinition-comments";
  src.requirements -> tgt.requirements "ElementDefinition-requirements";
  src.alias -> tgt.alias "ElementDefinition-alias";
  src.min -> tgt.min "ElementDefinition-min";
  src.max -> tgt.max "ElementDefinition-max";
  src.base as vs0 -> tgt.base as vt0 then {
    vs0.path -> vt0.path "base-path";
    vs0.min -> vt0.min "base-min";
    vs0.max -> vt0.max "base-max";
  } "ElementDefinition-base";
  src.type as vs0 where first.not() -> tgt.type as vt0 then type(vs0, vt0) "ElementDefinition-type";
  src.nameReference -> tgt.contentReference "ElementDefinition-nameReference";
  src.defaultValue -> tgt.defaultValue "ElementDefinition-defaultValue";
  src.meaningWhenMissing -> tgt.meaningWhenMissing "ElementDefinition-meaningWhenMissing";
  src.example as v ->  tgt.example as ve,  ve.label = 'General',  ve.value = v "ElementDefinition-example";
  src.fixed -> tgt.fixed "ElementDefinition-fixed";
  src.pattern -> tgt.pattern "ElementDefinition-pattern";
  src.minValue -> tgt.minValue "ElementDefinition-minValue";
  src.maxValue -> tgt.maxValue "ElementDefinition-maxValue";
  src.maxLength -> tgt.maxLength "ElementDefinition-maxLength";
  src.condition -> tgt.condition "ElementDefinition-condition";
  src.constraint as vs0 -> tgt.constraint as vt0 then constraint(vs0, vt0) "ElementDefinition-constraint";
  src.mustSupport -> tgt.mustSupport "ElementDefinition-mustSupport";
  src.isModifier -> tgt.isModifier "ElementDefinition-isModifier";
  src.isSummary -> tgt.isSummary "ElementDefinition-isSummary";
  src.binding as vs0 -> tgt.binding as vt0 then binding(vs0, vt0) "ElementDefinition-binding";
  src.mapping as vs0 -> tgt.mapping as vt0 then mapping(vs0, vt0) "ElementDefinition-mapping";
}

group binding(source src, target tgt) extends Element {
  src.strength -> tgt.strength "binding-strength";
  src.description -> tgt.description "binding-description";
  src.valueSet -> tgt.valueSet "binding-valueSet";
}

group type(source src, target tgt) extends Element {
  src.code -> tgt.code "type-code";
  src.profile where src.code = 'Reference' -> tgt.profile "type-profile1";
  src.profile where src.code != 'Reference' -> tgt.targetProfile "type-profile2";
  src.aggregation -> tgt.aggregation "type-aggregation";
}

group constraint(source src, target tgt) extends Element {
  src.key -> tgt.key "constraint-key";
  src.requirements -> tgt.requirements "constraint-requirements";
  src.severity -> tgt.severity "constraint-severity";
  src.human -> tgt.human "constraint-human";
  src.xpath -> tgt.xpath "constraint-xpath";
  src -> tgt.expression = 'todo' "constraint-expression";
}

group mapping(source src, target tgt) extends Element {
  src.identity -> tgt.identity "mapping-identity";
  src.language -> tgt.language "mapping-language";
  src.map -> tgt.map "mapping-map";
}