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: MedicationAdministration Transforms: R2 to R3

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

MedicationAdministrationTransformsR2toR3

/// url = 'http://hl7.org/fhir/StructureMap/MedicationAdministration2to3'
/// name = 'MedicationAdministration2to3'
/// title = 'MedicationAdministration Transforms: R2 to R3'
/// status = 'active'

uses "http://hl7.org/fhir/1.0/MedicationAdministration" alias MedicationAdministrationR2 as source
uses "http://hl7.org/fhir/1.0/MedicationAdministration" alias RatioR2 as source
uses "http://hl7.org/fhir/3.0/MedicationAdministration" alias MedicationAdministration as target

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

group MedicationAdministration(source src : MedicationAdministrationR2, target tgt : MedicationAdministration) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier "MedicationAdministration-identifier";
  src.status -> tgt.status "MedicationAdministration-status";
  src.patient -> tgt.subject "MedicationAdministration-patient";
  src.practitioner as v ->  tgt.performer as vd,  vd.actor = v "MedicationAdministration-practitioner";
  src.encounter -> tgt.context "MedicationAdministration-encounter";
  src.prescription -> tgt.prescription "MedicationAdministration-prescription";
  src.wasNotGiven -> tgt.notGiven "MedicationAdministration-notGiven";
  src.reasonNotGiven -> tgt.reasonNotGiven "MedicationAdministration-reasonNotGiven";
  src.effectiveTime -> tgt.effective "MedicationAdministration-effectiveTime";
  src.medication -> tgt.medication "MedicationAdministration-medication";
  src.device -> tgt.device "MedicationAdministration-device";
  src.note -> tgt.note "MedicationAdministration-note";
  src.dosage as vs0 -> tgt.dosage as vt0 then mAdDosage(vs0, vt0) "MedicationAdministration-dosage";
}

group mAdDosage(source src : MedicationAdministrationR2, target tgt : MedicationAdministration) extends BackboneElement {
  src.text -> tgt.text "dosage-text";
  src.site -> tgt.site "dosage-site";
  src.route -> tgt.route "dosage-route";
  src.method -> tgt.method "dosage-method";
  src.quantity -> tgt.dose "dosage-dose";
  src.rate where $this is Ratio -> tgt.rate "dosage-rate-Ratio";
}