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: Ingredient Transforms: R5 to R4B

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

IngredientTransformsR5toR4B

/// url = 'http://hl7.org/fhir/StructureMap/Ingredient5to4B'
/// name = 'Ingredient5to4B'
/// title = 'Ingredient Transforms: R5 to R4B'
/// status = 'active'

uses "http://hl7.org/fhir/5.0/Ingredient" alias IngredientR5 as source
uses "http://hl7.org/fhir/4.0/Ingredient" alias IngredientR4B as target

imports "http://hl7.org/fhir/StructureMap/*5to4B"

group Ingredient(source src : IngredientR5, target tgt : IngredientR4B) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/Ingredient.status-R5toR4', 'code');
  src.for -> tgt.for;
  src.role -> tgt.role;
  src.function -> tgt.function;
  src.allergenicIndicator -> tgt.allergenicIndicator;
  src.manufacturer as s -> tgt.manufacturer as t then IngredientManufacturer(s, t);
  src.substance as s -> tgt.substance as t then IngredientSubstance(s, t);
}

group IngredientManufacturer(source src, target tgt) extends BackboneElement {
  src.role as v -> tgt.role = translate(v, 'http://hl7.org/fhir/ConceptMap/Ingredient.manufacturer.role-R5toR4', 'code');
  src.manufacturer -> tgt.manufacturer;
}

group IngredientSubstance(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.strength as s -> tgt.strength as t then IngredientSubstanceStrength(s, t);
}

group IngredientSubstanceStrength(source src, target tgt) extends BackboneElement {
  src.presentation : Ratio -> tgt.presentation;
  src.presentation : RatioRange -> tgt.presentation;
  src.textPresentation -> tgt.textPresentation;
  src.concentration : Ratio -> tgt.concentration;
  src.concentration : RatioRange -> tgt.concentration;
  src.textConcentration -> tgt.textConcentration;
  src.measurementPoint -> tgt.measurementPoint;
  src.country -> tgt.country;
  src.referenceStrength as s -> tgt.referenceStrength as t then IngredientSubstanceStrengthReferenceStrength(s, t);
}

group IngredientSubstanceStrengthReferenceStrength(source src, target tgt) extends BackboneElement {
  src.substance -> tgt.substance;
  src.strength : Ratio -> tgt.strength;
  src.strength : RatioRange -> tgt.strength;
  src.measurementPoint -> tgt.measurementPoint;
  src.country -> tgt.country;
}