FHIR Extensions Pack
5.1.0-ballot1 - Ballot for Release 5.1.0 International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0-ballot: Releases Ballot 4) based on FHIR (HL7® FHIR® Standard) v5.0.0. The current version which supersedes this version is 1.0.0. For a full list of available versions, see the Directory of published versions

StructureMap: FML Conversion for NutritionOrder: R4 to R5

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

FMLConversionforNutritionOrderR4toR5

/// url = 'http://hl7.org/fhir/StructureMap/NutritionOrder4to5'
/// name = 'NutritionOrder4to5'
/// title = 'FML Conversion for NutritionOrder: R4 to R5'
/// status = 'active'

conceptmap "NutritiionOrderIntent" {
  prefix s = "http://hl7.org/fhir/4.0/request-intent"
  prefix t = "http://hl7.org/fhir/request-intent"

  s:proposal - t:proposal
  s:plan - t:plan
  s:directive - t:directive
  s:order - t:order
  s:"original-order" - t:"original-order"
  s:"reflex-order" - t:"reflex-order"
  s:"filler-order" - t:"filler-order"
  s:"instance-order" - t:"instance-order"
  s:option - t:option
}

conceptmap "NutritionOrderStatus" {
  prefix s = "http://hl7.org/fhir/4.0/request-status"
  prefix t = "http://hl7.org/fhir/request-status"

  s:draft - t:draft
  s:active - t:active
  s:"on-hold" - t:"on-hold"
  s:revoked - t:revoked
  s:completed - t:completed
  s:"entered-in-error" - t:"entered-in-error"
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/NutritionOrder" alias NutritionOrderR4 as source
uses "http://hl7.org/fhir/StructureDefinition/NutritionOrder" alias NutritionOrderR5 as target

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

group NutritionOrder(source src : NutritionOrderR4, 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, '#NutritionOrderStatus', 'code'); // src.basedOn -> tgt.basedOn;
  src.intent as v -> tgt.intent = translate(v, '#NutritiionOrderIntent', 'code');
  src.patient -> tgt.subject; // src.priority as v -> tgt.priority = translate(v, '#NutritionOrderPriority', 'code');
  src.encounter -> tgt.encounter;
  src.dateTime -> tgt.dateTime; // src.supportingInformation -> tgt.supportingInformation;
  src.orderer -> tgt.orderer;
  src.allergyIntolerance -> tgt.allergyIntolerance; // src.performer -> tgt.performer;
  src.foodPreferenceModifier -> tgt.foodPreferenceModifier;
  src.excludeFoodModifier -> tgt.excludeFoodModifier;
  src.oralDiet as s -> tgt.oralDiet as t then NutritionOrderOralDiet(s, t); // src.outsideFoodAllowed -> tgt.outsideFoodAllowed;
  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.deliveryDevice -> tgt.deliveryDevice;
  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;
}