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: Device Transforms: R5 to R4

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

DeviceTransformsR5toR4

/// url = 'http://hl7.org/fhir/StructureMap/Device5to4'
/// name = 'Device5to4'
/// title = 'Device Transforms: R5 to R4'
/// status = 'active'

uses "http://hl7.org/fhir/5.0/Device" alias DeviceR5 as source
uses "http://hl7.org/fhir/4.0/Device" alias DeviceR4 as target

imports "http://hl7.org/fhir/StructureMap/*5to4"

group Device(source src : DeviceR5, target tgt : DeviceR4) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.definition -> tgt.definition;
  src.udiCarrier as s -> tgt.udiCarrier as t then DeviceUdiCarrier(s, t);
  src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/Device.status-R5toR4', 'code');
  src.manufacturer -> tgt.manufacturer;
  src.manufactureDate -> tgt.manufactureDate;
  src.expirationDate -> tgt.expirationDate;
  src.lotNumber -> tgt.lotNumber;
  src.serialNumber -> tgt.serialNumber;
  src.name as s -> tgt.deviceName as t then DeviceName(s, t);
  src.modelNumber -> tgt.modelNumber;
  src.partNumber -> tgt.partNumber;
  src.type -> tgt.type;
  src.version as s -> tgt.version as t then DeviceVersion(s, t);
  src.property as s -> tgt.property as t then DeviceProperty(s, t);
  src.owner -> tgt.owner;
  src.contact -> tgt.contact;
  src.location -> tgt.location;
  src.url -> tgt.url;
  src.note -> tgt.note;
  src.safety -> tgt.safety;
  src.parent -> tgt.parent;
}

group DeviceUdiCarrier(source src, target tgt) extends BackboneElement {
  src.deviceIdentifier -> tgt.deviceIdentifier;
  src.issuer -> tgt.issuer;
  src.jurisdiction -> tgt.jurisdiction;
  src.carrierAIDC -> tgt.carrierAIDC;
  src.carrierHRF -> tgt.carrierHRF;
  src.entryType as v -> tgt.entryType = translate(v, 'http://hl7.org/fhir/ConceptMap/Device.udiCarrier.entryType-R5toR4', 'code');
}

group DeviceName(source src, target tgt) extends BackboneElement {
  src.value -> tgt.name;
  src.type as v -> tgt.type = translate(v, 'http://hl7.org/fhir/ConceptMap/Device.name.type-R5toR4', 'code');
}

group DeviceVersion(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.component -> tgt.component;
  src.value -> tgt.value;
}

// group DeviceConformsTo(source src, target tgt) extends BackboneElement {
// src.category -> tgt.category;
// src.specification -> tgt.specification;
// src.version -> tgt.version;
// }
group DeviceProperty(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : Quantity -> tgt.valueQuantity;
  src.value : CodeableConcept -> tgt.valueCode;
}