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

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

FMLConversionforDeviceUsageR5toR4

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

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

  s:active - t:active
  s:completed - t:completed
  s:"not-done" - t:intended
  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/StructureDefinition/DeviceUsage" alias DeviceUsageR5 as source
uses "http://hl7.org/fhir/4.0/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR4 as target

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

group DeviceUsage(source src : DeviceUsageR5, target tgt : DeviceUseStatementR4) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.basedOn -> tgt.basedOn;
  src.status as v -> tgt.status = translate(v, '#DeviceUsageStatus', 'code');
  src.patient -> tgt.subject; // 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.dateAsserted -> tgt.recordedOn;
  src.informationSource -> tgt.source; // src.usageStatus as v -> tgt.usageStatus = translate(v, '#DeviceUsageStatus', 'code');
  src.device -> tgt.device;
  src.reason -> tgt.reasonCode;
  src.reason -> tgt.reasonReference;
  src.bodySite -> tgt.bodySite;
  src.note -> tgt.note;
}