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 ValueSet: R4 to R5

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

FMLConversionforValueSetR4toR5

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

conceptmap "FilterOperator" {
  prefix s = "http://hl7.org/fhir/4.0/filter-operator"
  prefix t = "http://hl7.org/fhir/filter-operator"

  s:"=" - t:"="
  s:"is-a" - t:"is-a"
  s:"descendent-of" - t:"descendent-of"
  s:"is-not-a" - t:"is-not-a"
  s:regex - t:regex
  s:in - t:in
  s:"not-in" - t:"not-in"
  s:generalizes - t:generalizes
  s:exists - t:exists
}

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

  s:draft - t:draft
  s:active - t:active
  s:retired - t:retired
  s:unknown - t:unknown
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/ValueSet" alias ValueSetR4 as source
uses "http://hl7.org/fhir/StructureDefinition/ValueSet" alias ValueSetR5 as target

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

group ValueSet(source src : ValueSetR4, target tgt : ValueSetR5) extends DomainResource <<type+>> {
  src.url -> tgt.url;
  src.identifier -> tgt.identifier;
  src.version -> tgt.version;
  src.name -> tgt.name; // src.versionAlgorithm : string -> tgt.versionAlgorithm;
  src.title -> tgt.title;
  src.status as v -> tgt.status = translate(v, '#PublicationStatus', 'code');
  src.experimental -> tgt.experimental;
  src.date -> tgt.date;
  src.publisher -> tgt.publisher;
  src.contact -> tgt.contact;
  src.description -> tgt.description;
  src.useContext -> tgt.useContext;
  src.jurisdiction -> tgt.jurisdiction;
  src.immutable -> tgt.immutable;
  src.purpose -> tgt.purpose;
  src.copyright -> tgt.copyright;
  src.compose as s -> tgt.compose as t then ValueSetCompose(s, t); // src.copyrightLabel -> tgt.copyrightLabel;
  src.expansion as s -> tgt.expansion as t then ValueSetExpansion(s, t);
}

group ValueSetCompose(source src, target tgt) extends BackboneElement {
  src.lockedDate -> tgt.lockedDate;
  src.inactive -> tgt.inactive;
  src.include as s -> tgt.include as t then ValueSetComposeInclude(s, t);
}

group ValueSetComposeInclude(source src, target tgt) extends BackboneElement {
  src.system -> tgt.system;
  src.version -> tgt.version;
  src.concept as s -> tgt.concept as t then ValueSetComposeIncludeConcept(s, t);
  src.filter as s -> tgt.filter as t then ValueSetComposeIncludeFilter(s, t);
  src.valueSet -> tgt.valueSet;
}

group ValueSetComposeIncludeConcept(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.designation as s -> tgt.designation as t then ValueSetComposeIncludeConceptDesignation(s, t);
}

group ValueSetComposeIncludeConceptDesignation(source src, target tgt) extends BackboneElement {
  src.language -> tgt.language;
  src.use -> tgt.use;
  src.value -> tgt.value; // src.additionalUse -> tgt.additionalUse;
}

group ValueSetComposeIncludeFilter(source src, target tgt) extends BackboneElement {
  src.property -> tgt.property;
  src.op as v -> tgt.op = translate(v, '#FilterOperator', 'code');
  src.value -> tgt.value;
}

group ValueSetExpansion(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.timestamp -> tgt.timestamp; // src.next -> tgt.next;
  src.total -> tgt.total;
  src.offset -> tgt.offset;
  src.parameter as s -> tgt.parameter as t then ValueSetExpansionParameter(s, t);
  src.contains as s -> tgt.contains as t then ValueSetExpansionContains(s, t); // src.property as s -> tgt.property as t then ValueSetExpansionProperty(s,t);
}

group ValueSetExpansionParameter(source src, target tgt) extends BackboneElement {
  src.name -> tgt.name;
  src.value : string -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : code -> tgt.value;
  src.value : dateTime -> tgt.value;
}

group ValueSetExpansionContains(source src, target tgt) extends BackboneElement {
  src.system -> tgt.system;
  src.abstract -> tgt.abstract;
  src.inactive -> tgt.inactive;
  src.version -> tgt.version;
  src.code -> tgt.code;
  src.display -> tgt.display;
  src.contains as s -> tgt.contains as t then ValueSetExpansionContains(s, t); // src.property as s -> tgt.property as t then ValueSetExpansionContainsProperty(s,t);
}