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. For a full list of available versions, see the Directory of published versions

Patient Care 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 AllergyIntolerance

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

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

conceptmap "AllergyIntoleranceCategory" {
  prefix s = "http://hl7.org/fhir/allergy-intolerance-category"
  prefix t = "http://hl7.org/fhir/4.0/allergy-intolerance-category"

  s:food - t:food
  s:medication - t:medication
  s:environment - t:environment
  s:biologic - t:biologic
}

conceptmap "AllergyIntoleranceCriticality" {
  prefix s = "http://hl7.org/fhir/allergy-intolerance-criticality"
  prefix t = "http://hl7.org/fhir/4.0/allergy-intolerance-criticality"

  s:low - t:low
  s:high - t:high
  s:"unable-to-assess" - t:"unable-to-assess"
}

conceptmap "AllergyIntoleranceSeverity" {
  prefix s = "http://hl7.org/fhir/reaction-event-severity"
  prefix t = "http://hl7.org/fhir/4.0/reaction-event-severity"

  s:mild - t:mild
  s:moderate - t:moderate
  s:severe - t:severe
}

uses "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR5 as source
uses "http://hl7.org/fhir/4.0/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR4 as target

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

group AllergyIntolerance(source src : AllergyIntoleranceR5, target tgt : AllergyIntoleranceR4) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.clinicalStatus -> tgt.clinicalStatus;
  src.verificationStatus -> tgt.verificationStatus;
  src.type as s where code = 'allergy' ->  tgt.type = create('code') as t,  t.value = 'allergy';
  src.type as s where code = 'intolerance' ->  tgt.type = create('code') as t,  t.value = 'intolerance';
  src.category as v -> tgt.category = translate(v, '#AllergyIntoleranceCategory', 'code');
  src.criticality as v -> tgt.criticality = translate(v, '#AllergyIntoleranceCriticality', 'code');
  src.code -> tgt.code;
  src.patient -> tgt.patient;
  src.encounter -> tgt.encounter;
  src.onset : dateTime -> tgt.onset;
  src.onset : Age -> tgt.onset;
  src.onset : Period -> tgt.onset;
  src.onset : Range -> tgt.onset;
  src.onset : string -> tgt.onset;
  src.recordedDate -> tgt.recordedDate;
  src.participant as s where code = 'enterer' -> tgt then {
    s.actor -> tgt.recorder;
  };
  src.participant as s where code = 'author' -> tgt then {
    s.actor -> tgt.recorder;
  };
  src.lastOccurrence -> tgt.lastOccurrence;
  src.note -> tgt.note;
  src.reaction as s -> tgt.reaction as t then AllergyIntoleranceReaction(s, t);
}

// group AllergyIntoleranceParticipant(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group AllergyIntoleranceReaction(source src, target tgt) extends BackboneElement {
  src.substance -> tgt.substance;
  src.manifestation -> tgt.manifestation;
  src.description -> tgt.description;
  src.onset -> tgt.onset;
  src.severity as v -> tgt.severity = translate(v, '#AllergyIntoleranceSeverity', 'code');
  src.exposureRoute -> tgt.exposureRoute;
  src.note -> tgt.note;
}

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

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

conceptmap "AllergyIntoleranceCategory" {
  prefix s = "http://hl7.org/fhir/allergy-intolerance-category"
  prefix t = "http://hl7.org/fhir/4.3/allergy-intolerance-category"

  s:food - t:food
  s:medication - t:medication
  s:environment - t:environment
  s:biologic - t:biologic
}

conceptmap "AllergyIntoleranceCriticality" {
  prefix s = "http://hl7.org/fhir/allergy-intolerance-criticality"
  prefix t = "http://hl7.org/fhir/4.3/allergy-intolerance-criticality"

  s:low - t:low
  s:high - t:high
  s:"unable-to-assess" - t:"unable-to-assess"
}

conceptmap "AllergyIntoleranceSeverity" {
  prefix s = "http://hl7.org/fhir/reaction-event-severity"
  prefix t = "http://hl7.org/fhir/4.3/reaction-event-severity"

  s:mild - t:mild
  s:moderate - t:moderate
  s:severe - t:severe
}

uses "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR5 as source
uses "http://hl7.org/fhir/4.3/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR4B as target

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

group AllergyIntolerance(source src : AllergyIntoleranceR5, target tgt : AllergyIntoleranceR4B) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.clinicalStatus -> tgt.clinicalStatus;
  src.verificationStatus -> tgt.verificationStatus;
  src.type as s where code = 'allergy' ->  tgt.type = create('code') as t,  t.value = 'allergy';
  src.type as s where code = 'intolerance' ->  tgt.type = create('code') as t,  t.value = 'intolerance';
  src.category as v -> tgt.category = translate(v, '#AllergyIntoleranceCategory', 'code');
  src.criticality as v -> tgt.criticality = translate(v, '#AllergyIntoleranceCriticality', 'code');
  src.code -> tgt.code;
  src.patient -> tgt.patient;
  src.encounter -> tgt.encounter;
  src.onset : dateTime -> tgt.onset;
  src.onset : Age -> tgt.onset;
  src.onset : Period -> tgt.onset;
  src.onset : Range -> tgt.onset;
  src.onset : string -> tgt.onset;
  src.recordedDate -> tgt.recordedDate;
  src.participant as s where code = 'enterer' -> tgt then {
    s.actor -> tgt.recorder;
  };
  src.participant as s where code = 'author' -> tgt then {
    s.actor -> tgt.recorder;
  };
  src.lastOccurrence -> tgt.lastOccurrence;
  src.note -> tgt.note;
  src.reaction as s -> tgt.reaction as t then AllergyIntoleranceReaction(s, t);
}

// group AllergyIntoleranceParticipant(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group AllergyIntoleranceReaction(source src, target tgt) extends BackboneElement {
  src.substance -> tgt.substance;
  src.manifestation -> tgt.manifestation;
  src.description -> tgt.description;
  src.onset -> tgt.onset;
  src.severity as v -> tgt.severity = translate(v, '#AllergyIntoleranceSeverity', 'code');
  src.exposureRoute -> tgt.exposureRoute;
  src.note -> tgt.note;
}

Maps from AllergyIntolerance

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

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

conceptmap "AllergyIntoleranceCategory" {
  prefix s = "http://hl7.org/fhir/4.3/allergy-intolerance-category"
  prefix t = "http://hl7.org/fhir/allergy-intolerance-category"

  s:food - t:food
  s:medication - t:medication
  s:environment - t:environment
  s:biologic - t:biologic
}

conceptmap "AllergyIntoleranceCriticality" {
  prefix s = "http://hl7.org/fhir/4.3/allergy-intolerance-criticality"
  prefix t = "http://hl7.org/fhir/allergy-intolerance-criticality"

  s:low - t:low
  s:high - t:high
  s:"unable-to-assess" - t:"unable-to-assess"
}

conceptmap "AllergyIntoleranceSeverity" {
  prefix s = "http://hl7.org/fhir/4.3/reaction-event-severity"
  prefix t = "http://hl7.org/fhir/reaction-event-severity"

  s:mild - t:mild
  s:moderate - t:moderate
  s:severe - t:severe
}

uses "http://hl7.org/fhir/4.3/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR4B as source
uses "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR5 as target

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

group AllergyIntolerance(source src : AllergyIntoleranceR4B, target tgt : AllergyIntoleranceR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.clinicalStatus -> tgt.clinicalStatus;
  src.verificationStatus -> tgt.verificationStatus;
  src.type as s where type = 'allergy' ->  tgt.type = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://hl7.org/fhir/allergy-intolerance-type',  tc.code = 'allergy',  tc.display = 'Allergy';
  src.type as s where type = 'intolerance' ->  tgt.type = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://hl7.org/fhir/allergy-intolerance-type',  tc.code = 'intolerance',  tc.display = 'Intolerance';
  src.category as v -> tgt.category = translate(v, '#AllergyIntoleranceCategory', 'code');
  src.criticality as v -> tgt.criticality = translate(v, '#AllergyIntoleranceCriticality', 'code');
  src.code -> tgt.code;
  src.patient -> tgt.patient;
  src.encounter -> tgt.encounter;
  src.onset : dateTime -> tgt.onset;
  src.onset : Age -> tgt.onset;
  src.onset : Period -> tgt.onset;
  src.onset : Range -> tgt.onset;
  src.onset : string -> tgt.onset;
  src.recordedDate -> tgt.recordedDate;
  src.recorder as s -> tgt.participant as t then AllergyIntoleranceRecorder(s, t);
  src.asserter as s -> tgt.participant as t then AllergyIntoleranceAsserter(s, t);
  src.lastOccurrence -> tgt.lastOccurrence;
  src.note -> tgt.note;
  src.reaction as s -> tgt.reaction as t then AllergyIntoleranceReaction(s, t);
}

// group AllergyIntoleranceParticipant(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group AllergyIntoleranceRecorder(source src, target tgt) extends BackboneElement {
  src.reference as v ->  tgt.function = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://terminology.hl7.org/CodeSystem/provenance-participant-type',  tc.code = 'enterer',  tc.display = 'Enterer';
  src as s -> tgt.actor as t then Reference(s, t) "recorderReference";
}

group AllergyIntoleranceAsserter(source src, target tgt) extends BackboneElement {
  src.reference as v ->  tgt.function = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://terminology.hl7.org/CodeSystem/provenance-participant-type',  tc.code = 'author',  tc.display = 'Author';
  src as s -> tgt.actor as t then Reference(s, t) "asserterReference";
}

group AllergyIntoleranceReaction(source src, target tgt) extends BackboneElement {
  src.substance -> tgt.substance;
  src.manifestation -> tgt.manifestation;
  src.description -> tgt.description;
  src.onset -> tgt.onset;
  src.severity as v -> tgt.severity = translate(v, '#AllergyIntoleranceSeverity', 'code');
  src.exposureRoute -> tgt.exposureRoute;
  src.note -> tgt.note;
}

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

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

conceptmap "AllergyIntoleranceCategory" {
  prefix s = "http://hl7.org/fhir/4.0/allergy-intolerance-category"
  prefix t = "http://hl7.org/fhir/allergy-intolerance-category"

  s:food - t:food
  s:medication - t:medication
  s:environment - t:environment
  s:biologic - t:biologic
}

conceptmap "AllergyIntoleranceCriticality" {
  prefix s = "http://hl7.org/fhir/4.0/allergy-intolerance-criticality"
  prefix t = "http://hl7.org/fhir/allergy-intolerance-criticality"

  s:low - t:low
  s:high - t:high
  s:"unable-to-assess" - t:"unable-to-assess"
}

conceptmap "AllergyIntoleranceSeverity" {
  prefix s = "http://hl7.org/fhir/4.0/reaction-event-severity"
  prefix t = "http://hl7.org/fhir/reaction-event-severity"

  s:mild - t:mild
  s:moderate - t:moderate
  s:severe - t:severe
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR4 as source
uses "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR5 as target

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

group AllergyIntolerance(source src : AllergyIntoleranceR4, target tgt : AllergyIntoleranceR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.clinicalStatus -> tgt.clinicalStatus;
  src.verificationStatus -> tgt.verificationStatus;
  src.type as s where type = 'allergy' ->  tgt.type = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://hl7.org/fhir/allergy-intolerance-type',  tc.code = 'allergy',  tc.display = 'Allergy';
  src.type as s where type = 'intolerance' ->  tgt.type = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://hl7.org/fhir/allergy-intolerance-type',  tc.code = 'intolerance',  tc.display = 'Intolerance';
  src.category as v -> tgt.category = translate(v, '#AllergyIntoleranceCategory', 'code');
  src.criticality as v -> tgt.criticality = translate(v, '#AllergyIntoleranceCriticality', 'code');
  src.code -> tgt.code;
  src.patient -> tgt.patient;
  src.encounter -> tgt.encounter;
  src.onset : dateTime -> tgt.onset;
  src.onset : Age -> tgt.onset;
  src.onset : Period -> tgt.onset;
  src.onset : Range -> tgt.onset;
  src.onset : string -> tgt.onset;
  src.recordedDate -> tgt.recordedDate;
  src.recorder as s -> tgt.participant as t then AllergyIntoleranceRecorder(s, t);
  src.asserter as s -> tgt.participant as t then AllergyIntoleranceAsserter(s, t);
  src.lastOccurrence -> tgt.lastOccurrence;
  src.note -> tgt.note;
  src.reaction as s -> tgt.reaction as t then AllergyIntoleranceReaction(s, t);
}

// group AllergyIntoleranceParticipant(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group AllergyIntoleranceRecorder(source src, target tgt) extends BackboneElement {
  src.reference as v ->  tgt.function = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://terminology.hl7.org/CodeSystem/provenance-participant-type',  tc.code = 'enterer',  tc.display = 'Enterer';
  src as s -> tgt.actor as t then Reference(s, t) "recorderReference";
}

group AllergyIntoleranceAsserter(source src, target tgt) extends BackboneElement {
  src.reference as v ->  tgt.function = create('CodeableConcept') as t,  t.coding = create('Coding') as tc,  tc.system = 'http://terminology.hl7.org/CodeSystem/provenance-participant-type',  tc.code = 'author',  tc.display = 'Author';
  src as s -> tgt.actor as t then Reference(s, t) "asserterReference";
}

group AllergyIntoleranceReaction(source src, target tgt) extends BackboneElement {
  src.substance -> tgt.substance;
  src.manifestation -> tgt.manifestation;
  src.description -> tgt.description;
  src.onset -> tgt.onset;
  src.severity as v -> tgt.severity = translate(v, '#AllergyIntoleranceSeverity', 'code');
  src.exposureRoute -> tgt.exposureRoute;
  src.note -> tgt.note;
}