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: Location Transforms: R4B to R5

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

LocationTransformsR4BtoR5

/// url = 'http://hl7.org/fhir/StructureMap/Location4Bto5'
/// name = 'Location4Bto5'
/// title = 'Location Transforms: R4B to R5'
/// status = 'active'

uses "http://hl7.org/fhir/4.3/Location" alias LocationR4B as source
uses "http://hl7.org/fhir/5.0/Location" alias LocationR5 as target

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

group Location(source src : LocationR4B, target tgt : LocationR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/LocationB.status-R4BtoR5', 'code');
  src.operationalStatus -> tgt.operationalStatus;
  src.name -> tgt.name;
  src.alias -> tgt.alias;
  src.description -> tgt.description;
  src.mode as v -> tgt.mode = translate(v, 'http://hl7.org/fhir/ConceptMap/LocationB.mode-R4BtoR5', 'code');
  src.type -> tgt.type;
  src.telecom : ContactPoint as s ->  tgt.contact = create('ExtendedContactDetail') as t,  t.telecom = s;
  src.address -> tgt.address;
  src.physicalType -> tgt.form;
  src.position as s -> tgt.position as t then LocationPosition(s, t);
  src.managingOrganization -> tgt.managingOrganization;
  src.partOf -> tgt.partOf;
  src.hoursOfOperation : BackboneElement as s -> tgt.hoursOfOperation as t then LocationAvailabilityAvailableTime(s, t) "availableTime";
  src.endpoint -> tgt.endpoint;
}

group LocationPosition(source src, target tgt) extends BackboneElement {
  src.longitude -> tgt.longitude;
  src.latitude -> tgt.latitude;
  src.altitude -> tgt.altitude;
}

group LocationAvailabilityAvailableTime(source src, target tgt) extends BackboneElement {
  src.daysOfWeek as s ->  tgt.availableTime as t,  t.daysOfWeek = s;
  src.allDay as s ->  tgt.availableTime as t,  t.allDay = s;
  src.openingTime : time as s ->  tgt.availableTime as t,  t.availableStartTime = s;
  src.closingTime : time as s ->  tgt.availableTime as t,  t.availableEndTime = s;
}