FHIR Extensions Pack
5.1.0-snapshot1 - Working Copy International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0-snapshot1: Release 5.1) 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 Observation: R4 to R5

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

FMLConversionforObservationR4toR5

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

conceptmap "ObservationStatus" {
  prefix s = "http://hl7.org/fhir/4.0/observation-status"
  prefix t = "http://hl7.org/fhir/observation-status"

  s:registered - t:registered
  s:preliminary - t:preliminary
  s:final - t:final
  s:amended - t:amended
  s:corrected - t:corrected
  s:cancelled - t:cancelled
  s:"entered-in-error" - t:"entered-in-error"
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/Observation" alias ObservationR4 as source
uses "http://hl7.org/fhir/StructureDefinition/Observation" alias ObservationR5 as target

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

group Observation(source src : ObservationR4, target tgt : ObservationR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.basedOn -> tgt.basedOn; // src.instantiates : canonical -> tgt.instantiates;
  src.partOf -> tgt.partOf; // src.triggeredBy as s -> tgt.triggeredBy as t then ObservationTriggeredBy(s,t);
  src.status as v -> tgt.status = translate(v, '#ObservationStatus', 'code');
  src.category -> tgt.category;
  src.code -> tgt.code;
  src.subject -> tgt.subject;
  src.focus -> tgt.focus;
  src.encounter -> tgt.encounter;
  src.effective : dateTime -> tgt.effective;
  src.effective : Period -> tgt.effective;
  src.effective : Timing -> tgt.effective;
  src.effective : instant -> tgt.effective;
  src.issued -> tgt.issued;
  src.performer -> tgt.performer;
  src.value : Quantity -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : string -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : time -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : Period -> tgt.value;
  src.dataAbsentReason -> tgt.dataAbsentReason; // src.value : Attachment -> tgt.value;
  src.interpretation -> tgt.interpretation;
  src.note -> tgt.note;
  src.bodySite -> tgt.bodySite;
  src.method -> tgt.method; // src.bodyStructure -> tgt.bodyStructure;
  src.specimen -> tgt.specimen;
  src.device -> tgt.device;
  src.referenceRange as s -> tgt.referenceRange as t then ObservationReferenceRange(s, t);
  src.hasMember -> tgt.hasMember;
  src.derivedFrom -> tgt.derivedFrom;
  src.component as s -> tgt.component as t then ObservationComponent(s, t);
}

// group ObservationTriggeredBy(source src, target tgt) extends BackboneElement {
// src.observation -> tgt.observation;
// src.type as v -> tgt.type = translate(v, '#TriggeredByType', 'code');
// src.reason -> tgt.reason;
// }
group ObservationReferenceRange(source src, target tgt) extends BackboneElement {
  src.low -> tgt.low;
  src.high -> tgt.high;
  src.type -> tgt.type; // src.normalValue -> tgt.normalValue;
  src.appliesTo -> tgt.appliesTo;
  src.age -> tgt.age;
  src.text -> tgt.text;
}

group ObservationComponent(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.value : Quantity -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : string -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : time -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : Period -> tgt.value;
  src.dataAbsentReason -> tgt.dataAbsentReason; // src.value : Attachment -> tgt.value;
  src.interpretation -> tgt.interpretation;
}