FHIR Release 3 (STU)

This page is part of the FHIR Specification (v3.0.2: STU 3). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

Pharmacy Work GroupMaturity Level: N/ABallot Status: InformativeCompartments: Not linked to any defined compartments

R2 : R3 Converson maps for Medication.

Functional status for this map: 23 tests that all execute ok. 16 fail round-trip testing and 1 r3 resources are invalid (1 errors). (see documentation)

map "http://hl7.org/fhir/StructureMap/Medication2to3" = "R2 to R3 Conversions for Medication"

uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Medication" alias MedicationR2 as source
uses "http://hl7.org/fhir/StructureDefinition/Medication" alias Medication as target

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

group for type+types  Medication extends DomainResource
  input src : MedicationR2 as source
  input tgt : Medication as target

  "Medication-code" : for src.code make tgt.code
  "Medication-isBrand" : for src.isBrand make tgt.isBrand
  "Medication-manufacturer" : for src.manufacturer make tgt.manufacturer
  
  "Medication-product" : for src.product as vs0 then medProduct(vs0, tgt)
  "Medication-package" : for src.package as vs0 make tgt.package as vt0 then medPackage(vs0, vt0)
endgroup

group medProduct extends BackboneElement
  input src as source
  input tgt as target

  "Medication.product-form" : for src.form make tgt.form
  "Medication.product-ingredient" : for src.ingredient as vs0 make tgt.ingredient as vt0 then medIngredient(vs0, vt0)
  "Medication.product-batch" : for src.batch as vs0 make tgt.package as pkg, pkg.batch as vt0 then medBatch(vs0, vt0)
endgroup

group medIngredient extends BackboneElement
  input src as source
  input tgt as target

  "Medication.product.batch-item" : for src.item make tgt.item
  "Medication.product.batch-amount" : for src.amount make tgt.amount
endgroup

group medBatch extends BackboneElement
  input src as source
  input tgt as target

  "Medication.product.batch-lotNumber" : for src.lotNumber make tgt.lotNumber
  "Medication.product.batch-expirationDate" : for src.expirationDate make tgt.expirationDate
endgroup

group medPackage extends BackboneElement
  input src as source
  input tgt as target

  "Medication.package-container" : for src.container make tgt.container
  "Medication.package-content" : for src.content as vs0 make tgt.content as vt0 then medContent(vs0, vt0)
endgroup

group medContent extends BackboneElement
  input src as source
  input tgt as target

  "Medication.package.content-item" : for src.item make tgt.item
  "Medication.package.content-amount" : for src.amount make tgt.amount
endgroup


map "http://hl7.org/fhir/StructureMap/Medication3to2" = "R3 to R2 Conversion for Medication"

uses "http://hl7.org/fhir/StructureDefinition/Medication" alias Medication as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Medication" alias MedicationR2 as target

imports "http://hl7.org/fhir/StructureMap/*3to2"

group for type+types  Medication extends DomainResource
  input src : Medication as source
  input tgt : MedicationR2 as target

  "Medication-code" : for src.code make tgt.code
  "Medication-isBrand" : for src.isBrand make tgt.isBrand
  "Medication-manufacturer" : for src.manufacturer make tgt.manufacturer
  
  "Medication.product-form" : for src.form as v make tgt.product as vt0, vt0.form as v
  "Medication.product-ingredient" : for src.ingredient as vs0 make tgt.product as vt0, vt0.ingredient as vt1 then medIngredient(vs0, vt1)
  "Medication-package" : for src.package as vs0 make tgt.package as vt0 then medPackage(vs0, vt0, tgt)
endgroup

group medProduct extends BackboneElement
  input src as source
  input tgt as target

  "Medication.product-form" : for src.form make tgt.form
  "Medication.product-ingredient" : for src.ingredient as vs0 make tgt.ingredient as vt0 then medIngredient(vs0, vt0)
endgroup

group medIngredient extends BackboneElement
  input src as source
  input tgt as target

  "Medication.product.batch-item" : for src.item where $this is Reference make tgt.item
  "Medication.product.batch-amount" : for src.amount make tgt.amount
endgroup

group medBatch extends BackboneElement
  input src as source
  input tgt as target

  "Medication.product.batch-lotNumber" : for src.lotNumber make tgt.lotNumber
  "Medication.product.batch-expirationDate" : for src.expirationDate make tgt.expirationDate
endgroup

group medPackage extends BackboneElement
  input src as source
  input tgt as target
  input res as target

  "Medication.package-container" : for src.container make tgt.container
  "Medication.package-content" : for src.content as vs0 make tgt.content as vt0 then medContent(vs0, vt0)
  "Medication.product-batch" : for src.batch as vs0 make res.product as vt1, vt1.batch as vt0 then medBatch(vs0, vt0)
endgroup

group medContent extends BackboneElement
  input src as source
  input tgt as target

  "Medication.package.content-item" : for src.item where $this is Reference make tgt.item
  "Medication.package.content-amount" : for src.amount make tgt.amount
endgroup


medexample012
  • WARNING @ Medication.code.coding.display: value should not start or finish with whitespace (src = InstanceValidator)