FHIR Extensions Pack
1.0.0 - Working Copy International flag

This page is part of the FHIR Core Extensions Registry (v1.0.0: Releases) based on FHIR v5.0.0. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions

StructureMap: FML Conversion for DeviceUsage: R4 to R5

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

FMLConversionforDeviceUsageR4toR5

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

conceptmap "DeviceUsageStatus" {
  prefix s = "http://hl7.org/fhir/4.0/device-statement-status"
  prefix t = "http://hl7.org/fhir/deviceusage-status"

  s:active - t:active
  s:completed - t:completed
  s:"entered-in-error" - t:"entered-in-error"
  s:intended - t:intended
  s:stopped - t:stopped
  s:"on-hold" - t:"on-hold"
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR4 as source
uses "http://hl7.org/fhir/StructureDefinition/DeviceUsage" alias DeviceUsageR5 as target

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

group DeviceUsage(source src : DeviceUseStatementR4, target tgt : DeviceUsageR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.basedOn -> tgt.basedOn;
  src.status as v -> tgt.status = translate(v, '#DeviceUsageStatus', 'code');
  src.subject -> tgt.patient; // src.category -> tgt.category;
  src.derivedFrom -> tgt.derivedFrom;
  src.timing : Timing -> tgt.timing; // src.context -> tgt.context;
  src.timing : Period -> tgt.timing;
  src.timing : dateTime -> tgt.timing;
  src.recordedOn -> tgt.dateAsserted;
  src.source -> tgt.informationSource; // src.usageStatus as v -> tgt.usageStatus = translate(v, '#DeviceUsageStatus', 'code');
  src.device -> tgt.device;
  src.reasonCode -> tgt.reason;
  src.reasonReference -> tgt.reason;
  src.bodySite -> tgt.bodySite;
  src.note -> tgt.note;
}