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

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

NutritionOrderTransformsR4BtoR5

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

uses "http://hl7.org/fhir/4.3/NutritionOrder" alias NutritionOrderR4B as source
uses "http://hl7.org/fhir/5.0/NutritionOrder" alias NutritionOrderR5 as target

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

group NutritionOrder(source src : NutritionOrderR4B, target tgt : NutritionOrderR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.instantiatesCanonical;
  src.instantiatesUri -> tgt.instantiatesUri;
  src.instantiates -> tgt.instantiates;
  src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/NutritionOrderB.status-R4BtoR5', 'code');
  src.intent as v -> tgt.intent = translate(v, 'http://hl7.org/fhir/ConceptMap/NutritionOrderB.intent-R4BtoR5', 'code');
  src.patient -> tgt.subject;
  src.encounter -> tgt.encounter;
  src.dateTime -> tgt.dateTime;
  src.orderer -> tgt.orderer;
  src.allergyIntolerance -> tgt.allergyIntolerance;
  src.foodPreferenceModifier -> tgt.foodPreferenceModifier;
  src.excludeFoodModifier -> tgt.excludeFoodModifier;
  src.oralDiet as s -> tgt.oralDiet as t then NutritionOrderOralDiet(s, t);
  src.supplement as s -> tgt.supplement as t then NutritionOrderSupplement(s, t);
  src.enteralFormula as s -> tgt.enteralFormula as t then NutritionOrderEnteralFormula(s, t);
  src.note -> tgt.note;
}

group NutritionOrderOralDiet(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.schedule : Timing as s ->  tgt.schedule as t,  t.timing = s;
  src.nutrient as s -> tgt.nutrient as t then NutritionOrderOralDietNutrient(s, t);
  src.texture as s -> tgt.texture as t then NutritionOrderOralDietTexture(s, t);
  src.fluidConsistencyType -> tgt.fluidConsistencyType;
  src.instruction -> tgt.instruction;
}

// group NutritionOrderOralDietSchedule(source src, target tgt) extends BackboneElement {
// src.timing -> tgt.timing;
// src.asNeeded -> tgt.asNeeded;
// src.asNeededFor -> tgt.asNeededFor;
// }
group NutritionOrderOralDietNutrient(source src, target tgt) extends BackboneElement {
  src.modifier -> tgt.modifier;
  src.amount -> tgt.amount;
}

group NutritionOrderOralDietTexture(source src, target tgt) extends BackboneElement {
  src.modifier -> tgt.modifier;
  src.foodType -> tgt.foodType;
}

group NutritionOrderSupplement(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.productName -> tgt.productName;
  src.schedule : Timing as s ->  tgt.schedule as t,  t.timing = s;
  src.quantity -> tgt.quantity;
  src.instruction -> tgt.instruction;
}

// group NutritionOrderSupplementSchedule(source src, target tgt) extends BackboneElement {
// src.timing -> tgt.timing;
// src.asNeeded -> tgt.asNeeded;
// src.asNeededFor -> tgt.asNeededFor;
// }
group NutritionOrderEnteralFormula(source src, target tgt) extends BackboneElement {
  src.baseFormulaType -> tgt.baseFormulaType;
  src.baseFormulaProductName -> tgt.baseFormulaProductName;
  src.additiveType : CodeableConcept as s ->  tgt.additive as t,  t.type = s;
  src.additiveProductName as s ->  tgt.additive as t,  t.productName = s;
  src.caloricDensity -> tgt.caloricDensity;
  src.routeofAdministration -> tgt.routeOfAdministration;
  src.administration as s -> tgt.administration as t then NutritionOrderEnteralFormulaAdministration(s, t);
  src.maxVolumeToDeliver -> tgt.maxVolumeToDeliver;
  src.administrationInstruction -> tgt.administrationInstruction;
}

// group NutritionOrderEnteralFormulaAdditive(source src, target tgt) extends BackboneElement {
// src.type -> tgt.type;
// src.productName -> tgt.productName;
// src.quantity -> tgt.quantity;
// }
group NutritionOrderEnteralFormulaAdministration(source src, target tgt) extends BackboneElement {
  src.schedule : Timing as s ->  tgt.schedule as t,  t.timing = s;
  src.quantity -> tgt.quantity;
  src.rate : Quantity -> tgt.rate;
  src.rate : Ratio -> tgt.rate;
}