FHIR Extensions Pack
1.0.0 - Working Copy International flag

This page is part of the FHIR Core Extensions Registry (v1.0.0: Releases) based on FHIR v5.0.0. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions

StructureMap: FML Conversion for Ingredient: R4B to R5

Official URL: http://hl7.org/fhir/StructureMap/Ingredient4Bto5 Version: 1.0.0
Standards status: Trial-use Maturity Level: 1 Computable Name: Ingredient4Bto5

FMLConversionforIngredientR4BtoR5

/// url = 'http://hl7.org/fhir/StructureMap/Ingredient4Bto5'
/// name = 'Ingredient4Bto5'
/// title = 'FML Conversion for Ingredient: R4B to R5'
/// status = 'active'

conceptmap "IngredientManufacturerRole" {
  prefix s = "http://hl7.org/fhir/4.3/ingredient-manufacturer-role"
  prefix t = "http://hl7.org/fhir/ingredient-manufacturer-role"

  s:allowed - t:allowed
  s:possible - t:possible
  s:actual - t:actual
}

conceptmap "PublicationStatus" {
  prefix s = "http://hl7.org/fhir/4.3/publication-status"
  prefix t = "http://hl7.org/fhir/publication-status"

  s:draft - t:draft
  s:active - t:active
  s:retired - t:retired
  s:unknown - t:unknown
}

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

imports "http://hl7.org/fhir/StructureMap/*4Bto5"

group Ingredient(source src : IngredientR4B, target tgt : IngredientR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, '#PublicationStatus', 'code');
  src.for -> tgt.for;
  src.role -> tgt.role;
  src.function -> tgt.function;
  src.allergenicIndicator -> tgt.allergenicIndicator; // src.group -> tgt.group;
  src.manufacturer as s -> tgt.manufacturer as t then IngredientManufacturer(s, t); // src.comment -> tgt.comment;
  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, '#IngredientManufacturerRole', '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.presentation : CodeableConcept -> tgt.presentation;
  src.concentration : Ratio -> tgt.concentration;
  src.concentration : RatioRange -> tgt.concentration;
  src.textConcentration -> tgt.textConcentration; // src.concentration : CodeableConcept -> tgt.concentration;
  src.measurementPoint -> tgt.measurementPoint; // src.basis -> tgt.basis;
  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.strength : Quantity -> tgt.strength;
  src.country -> tgt.country;
}