FHIR Extensions Pack v1.0.0 (2023-03-26)

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

Patient Administration Work GroupMaturity Level: N/AStandards Status: InformativeSecurity Category: N/A Compartments: N/A

Following are maps for converting between the equivalent R4B resource and this R5 resource.

Maps to Encounter

FML Conversion for Encounter: R5 to R4 (Ready for Use/Trial Use)

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

conceptmap "EncounterLocationStatus" {
  prefix s = "http://hl7.org/fhir/encounter-location-status"
  prefix t = "http://hl7.org/fhir/4.0/encounter-location-status"

  s:planned - t:planned
  s:active - t:active
  s:reserved - t:reserved
  s:completed - t:completed
}

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

  s:planned - t:planned
  s:"in-progress" - t:triaged
  s:"on-hold" - t:onleave
  s:discharged - t:finished
  s:completed - t:finished
  s:cancelled - t:cancelled
  s:discontinued - t:cancelled
  s:"entered-in-error" - t:"entered-in-error"
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias EncounterR5 as source
uses "http://hl7.org/fhir/4.0/StructureDefinition/Encounter" alias EncounterR4 as target

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

group Encounter(source src : EncounterR5, target tgt : EncounterR4) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, '#EncounterStatus', 'code');
  src.class as s -> tgt then {
    s.coding as sc -> tgt.class as t then Coding(sc, t);
  }; // src.class as s -> tgt.class = create('Coding') as tc, tc.system = (s.system), tc.code = (s.code), tc.display = s.display;
  src.priority -> tgt.priority;
  src.type -> tgt.type;
  src.serviceType -> tgt.serviceType;
  src.subject -> tgt.subject;
  src.episodeOfCare -> tgt.episodeOfCare; // src.subjectStatus -> tgt.subjectStatus;
  src.basedOn -> tgt.basedOn;
  src.partOf -> tgt.partOf; // src.careTeam -> tgt.careTeam;
  src.serviceProvider -> tgt.serviceProvider;
  src.participant as s -> tgt.participant as t then EncounterParticipant(s, t);
  src.appointment -> tgt.appointment;
  src.actualPeriod -> tgt.period; // src.virtualService -> tgt.virtualService;
  src.length -> tgt.length; // src.plannedStartDate -> tgt.plannedStartDate;
  src.diagnosis as s -> tgt.diagnosis as t then EncounterDiagnosis(s, t); // src.reason as s -> tgt.reason as t then EncounterReason(s,t);
  src.account -> tgt.account;
  src.admission as s -> tgt.hospitalization as t then EncounterAdmission(s, t); // src.dietPreference -> tgt.dietPreference;
  src.location as s -> tgt.location as t then EncounterLocation(s, t);
}

group EncounterParticipant(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.period -> tgt.period;
  src.actor -> tgt.individual;
}

// group EncounterReason(source src, target tgt) extends BackboneElement {
// src.use -> tgt.use;
// src.value -> tgt.value;
// }
group EncounterDiagnosis(source src, target tgt) extends BackboneElement {
  src.condition -> tgt.condition;
  src.use -> tgt.use;
}

group EncounterAdmission(source src, target tgt) extends BackboneElement {
  src.preAdmissionIdentifier -> tgt.preAdmissionIdentifier;
  src.origin -> tgt.origin;
  src.admitSource -> tgt.admitSource;
  src.reAdmission -> tgt.reAdmission;
  src.destination -> tgt.destination;
  src.dischargeDisposition -> tgt.dischargeDisposition;
}

group EncounterLocation(source src, target tgt) extends BackboneElement {
  src.location -> tgt.location;
  src.status as v -> tgt.status = translate(v, '#EncounterLocationStatus', 'code');
  src.form -> tgt.physicalType;
  src.period -> tgt.period;
}

FML Conversion for Encounter: R5 to R4B (Ready for Use/Trial Use)

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

conceptmap "EncounterLocationStatus" {
  prefix s = "http://hl7.org/fhir/encounter-location-status"
  prefix t = "http://hl7.org/fhir/4.3/encounter-location-status"

  s:planned - t:planned
  s:active - t:active
  s:reserved - t:reserved
  s:completed - t:completed
}

conceptmap "EncounterStatus" {
  prefix s = "http://hl7.org/fhir/encounter-status"
  prefix t = "http://hl7.org/fhir/4.3/encounter-status"

  s:planned - t:planned
  s:"in-progress" - t:triaged
  s:"on-hold" - t:onleave
  s:discharged - t:finished
  s:completed - t:finished
  s:cancelled - t:cancelled
  s:discontinued - t:cancelled
  s:"entered-in-error" - t:"entered-in-error"
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias EncounterR5 as source
uses "http://hl7.org/fhir/4.3/StructureDefinition/Encounter" alias EncounterR4B as target

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

group Encounter(source src : EncounterR5, target tgt : EncounterR4B) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, '#EncounterStatus', 'code');
  src.class as s -> tgt then {
    s.coding as sc -> tgt.class as t then Coding(sc, t);
  }; // src.class as s -> tgt.class = create('Coding') as tc, tc.system = (s.system), tc.code = (s.code), tc.display = s.display;
  src.priority -> tgt.priority;
  src.type -> tgt.type;
  src.serviceType -> tgt.serviceType;
  src.subject -> tgt.subject;
  src.episodeOfCare -> tgt.episodeOfCare; // src.subjectStatus -> tgt.subjectStatus;
  src.basedOn -> tgt.basedOn;
  src.partOf -> tgt.partOf; // src.careTeam -> tgt.careTeam;
  src.serviceProvider -> tgt.serviceProvider;
  src.participant as s -> tgt.participant as t then EncounterParticipant(s, t);
  src.appointment -> tgt.appointment;
  src.actualPeriod -> tgt.period; // src.virtualService -> tgt.virtualService;
  src.length -> tgt.length; // src.plannedStartDate -> tgt.plannedStartDate;
  src.diagnosis as s -> tgt.diagnosis as t then EncounterDiagnosis(s, t); // src.reason as s -> tgt.reason as t then EncounterReason(s,t);
  src.account -> tgt.account;
  src.admission as s -> tgt.hospitalization as t then EncounterAdmission(s, t); // src.dietPreference -> tgt.dietPreference;
  src.location as s -> tgt.location as t then EncounterLocation(s, t);
}

group EncounterParticipant(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.period -> tgt.period;
  src.actor -> tgt.individual;
}

// group EncounterReason(source src, target tgt) extends BackboneElement {
// src.use -> tgt.use;
// src.value -> tgt.value;
// }
group EncounterDiagnosis(source src, target tgt) extends BackboneElement {
  src.condition -> tgt.condition;
  src.use -> tgt.use;
}

group EncounterAdmission(source src, target tgt) extends BackboneElement {
  src.preAdmissionIdentifier -> tgt.preAdmissionIdentifier;
  src.origin -> tgt.origin;
  src.admitSource -> tgt.admitSource;
  src.reAdmission -> tgt.reAdmission;
  src.destination -> tgt.destination;
  src.dischargeDisposition -> tgt.dischargeDisposition;
}

group EncounterLocation(source src, target tgt) extends BackboneElement {
  src.location -> tgt.location;
  src.status as v -> tgt.status = translate(v, '#EncounterLocationStatus', 'code');
  src.form -> tgt.physicalType;
  src.period -> tgt.period;
}

Maps from Encounter

FML Conversion for Encounter: R4B to R5 (Ready for Use/Trial Use)

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

conceptmap "EncounterLocationStatus" {
  prefix s = "http://hl7.org/fhir/4.3/encounter-location-status"
  prefix t = "http://hl7.org/fhir/encounter-location-status"

  s:planned - t:planned
  s:active - t:active
  s:reserved - t:reserved
  s:completed - t:completed
}

conceptmap "EncounterStatus" {
  prefix s = "http://hl7.org/fhir/4.3/encounter-status"
  prefix t = "http://hl7.org/fhir/encounter-status"

  s:planned - t:planned
  s:arrived - t:planned
  s:triaged - t:"in-progress"
  s:"in-progress" - t:"in-progress"
  s:onleave - t:"on-hold"
  s:finished - t:completed
  s:cancelled - t:cancelled
  s:"entered-in-error" - t:"entered-in-error"
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/4.3/StructureDefinition/Encounter" alias EncounterR4B as source
uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias EncounterR5 as target

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

group Encounter(source src : EncounterR4B, target tgt : EncounterR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, '#EncounterStatus', 'code');
  src.class as s ->  tgt.class = create('CodeableConcept') as t,  t.coding as tc then Coding(s, tc); // src.class as s -> tgt.class = create('CodeableConcept') as t, t.coding = create('Coding') as tc, tc.system = (s.system), tc.code = (s.code), tc.display = s.display;
  src.priority -> tgt.priority;
  src.type -> tgt.type;
  src.serviceType -> tgt.serviceType;
  src.subject -> tgt.subject;
  src.episodeOfCare -> tgt.episodeOfCare; // src.subjectStatus -> tgt.subjectStatus;
  src.basedOn -> tgt.basedOn;
  src.partOf -> tgt.partOf; // src.careTeam -> tgt.careTeam;
  src.serviceProvider -> tgt.serviceProvider;
  src.participant as s -> tgt.participant as t then EncounterParticipant(s, t);
  src.appointment -> tgt.appointment;
  src.period -> tgt.actualPeriod; // src.virtualService -> tgt.virtualService;
  src.length -> tgt.length; // src.plannedStartDate -> tgt.plannedStartDate;
  src.diagnosis as s -> tgt.diagnosis as t then EncounterDiagnosis(s, t); // src.reason as s -> tgt.reason as t then EncounterReason(s,t);
  src.account -> tgt.account;
  src.hospitalization as s -> tgt.admission as t then EncounterAdmission(s, t); // src.dietPreference -> tgt.dietPreference;
  src.location as s -> tgt.location as t then EncounterLocation(s, t);
}

group EncounterParticipant(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.period -> tgt.period;
  src.individual -> tgt.actor;
}

// group EncounterReason(source src, target tgt) extends BackboneElement {
// src.use -> tgt.use;
// src.value -> tgt.value;
// }
group EncounterDiagnosis(source src, target tgt) extends BackboneElement {
  src.condition -> tgt.condition;
  src.use -> tgt.use;
}

group EncounterAdmission(source src, target tgt) extends BackboneElement {
  src.preAdmissionIdentifier -> tgt.preAdmissionIdentifier;
  src.origin -> tgt.origin;
  src.admitSource -> tgt.admitSource;
  src.reAdmission -> tgt.reAdmission;
  src.destination -> tgt.destination;
  src.dischargeDisposition -> tgt.dischargeDisposition;
}

group EncounterLocation(source src, target tgt) extends BackboneElement {
  src.location -> tgt.location;
  src.status as v -> tgt.status = translate(v, '#EncounterLocationStatus', 'code');
  src.physicalType -> tgt.form;
  src.period -> tgt.period;
}

FML Conversion for Encounter: R4 to R5 (Ready for Use/Trial Use)

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

conceptmap "EncounterLocationStatus" {
  prefix s = "http://hl7.org/fhir/4.0/encounter-location-status"
  prefix t = "http://hl7.org/fhir/encounter-location-status"

  s:planned - t:planned
  s:active - t:active
  s:reserved - t:reserved
  s:completed - t:completed
}

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

  s:planned - t:planned
  s:arrived - t:planned
  s:triaged - t:"in-progress"
  s:"in-progress" - t:"in-progress"
  s:onleave - t:"on-hold"
  s:finished - t:completed
  s:cancelled - t:cancelled
  s:"entered-in-error" - t:"entered-in-error"
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/Encounter" alias EncounterR4 as source
uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias EncounterR5 as target

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

group Encounter(source src : EncounterR4, target tgt : EncounterR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.status as v -> tgt.status = translate(v, '#EncounterStatus', 'code');
  src.class as s ->  tgt.class = create('CodeableConcept') as t,  t.coding as tc then Coding(s, tc); // src.class as s -> tgt.class = create('CodeableConcept') as t, t.coding = create('Coding') as tc, tc.system = (s.system), tc.code = (s.code), tc.display = s.display;
  src.priority -> tgt.priority;
  src.type -> tgt.type;
  src.serviceType -> tgt.serviceType;
  src.subject -> tgt.subject;
  src.episodeOfCare -> tgt.episodeOfCare; // src.subjectStatus -> tgt.subjectStatus;
  src.basedOn -> tgt.basedOn;
  src.partOf -> tgt.partOf; // src.careTeam -> tgt.careTeam;
  src.serviceProvider -> tgt.serviceProvider;
  src.participant as s -> tgt.participant as t then EncounterParticipant(s, t);
  src.appointment -> tgt.appointment;
  src.period -> tgt.actualPeriod; // src.virtualService -> tgt.virtualService;
  src.length -> tgt.length; // src.plannedStartDate -> tgt.plannedStartDate;
  src.diagnosis as s -> tgt.diagnosis as t then EncounterDiagnosis(s, t); // src.reason as s -> tgt.reason as t then EncounterReason(s,t);
  src.account -> tgt.account;
  src.hospitalization as s -> tgt.admission as t then EncounterAdmission(s, t); // src.dietPreference -> tgt.dietPreference;
  src.location as s -> tgt.location as t then EncounterLocation(s, t);
}

group EncounterParticipant(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.period -> tgt.period;
  src.individual -> tgt.actor;
}

// group EncounterReason(source src, target tgt) extends BackboneElement {
// src.use -> tgt.use;
// src.value -> tgt.value;
// }
group EncounterDiagnosis(source src, target tgt) extends BackboneElement {
  src.condition -> tgt.condition;
  src.use -> tgt.use;
}

group EncounterAdmission(source src, target tgt) extends BackboneElement {
  src.preAdmissionIdentifier -> tgt.preAdmissionIdentifier;
  src.origin -> tgt.origin;
  src.admitSource -> tgt.admitSource;
  src.reAdmission -> tgt.reAdmission;
  src.destination -> tgt.destination;
  src.dischargeDisposition -> tgt.dischargeDisposition;
}

group EncounterLocation(source src, target tgt) extends BackboneElement {
  src.location -> tgt.location;
  src.status as v -> tgt.status = translate(v, '#EncounterLocationStatus', 'code');
  src.physicalType -> tgt.form;
  src.period -> tgt.period;
}