FHIR Extensions Pack
5.1.0 - 5.1.0 (April 2024) International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0: Release 5.1) based on FHIR (HL7® FHIR® Standard) v5.0.0. This is the current published version. For a full list of available versions, see the Directory of published versions

StructureMap: FML Conversion for DeviceUsage: R5 to R4B

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

FMLConversionforDeviceUsageR5toR4B

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

conceptmap "DeviceUsageStatus" {
  prefix s = "http://hl7.org/fhir/deviceusage-status"
  prefix t = "http://hl7.org/fhir/4.3/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.3/StructureDefinition/DeviceUseStatement" alias DeviceUseStatementR4B as target

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

group DeviceUsage(source src : DeviceUsageR5, target tgt : DeviceUseStatementR4B) 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;
}