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

Orders and Observations 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 Task

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

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

conceptmap "TaskPriority" {
  prefix s = "http://hl7.org/fhir/request-priority"
  prefix t = "http://hl7.org/fhir/4.0/request-priority"

  s:routine - t:routine
  s:urgent - t:urgent
  s:asap - t:asap
  s:stat - t:stat
}

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

  s:draft - t:draft
  s:requested - t:requested
  s:received - t:received
  s:accepted - t:accepted
  s:rejected - t:rejected
  s:ready - t:ready
  s:cancelled - t:cancelled
  s:"in-progress" - t:"in-progress"
  s:"on-hold" - t:"on-hold"
  s:failed - t:failed
  s:completed - t:completed
  s:"entered-in-error" - t:"entered-in-error"
}

uses "http://hl7.org/fhir/StructureDefinition/Task" alias TaskR5 as source
uses "http://hl7.org/fhir/4.0/StructureDefinition/Task" alias TaskR4 as target

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

group Task(source src : TaskR5, target tgt : TaskR4) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.instantiatesCanonical;
  src.instantiatesUri -> tgt.instantiatesUri;
  src.basedOn -> tgt.basedOn;
  src.groupIdentifier -> tgt.groupIdentifier;
  src.partOf -> tgt.partOf;
  src.status as v -> tgt.status = translate(v, '#TaskStatus', 'code');
  src.statusReason -> tgt.statusReason;
  src.businessStatus -> tgt.businessStatus;
  src.intent -> tgt.intent;
  src.priority as v -> tgt.priority = translate(v, '#TaskPriority', 'code');
  src.code -> tgt.code; // src.doNotPerform -> tgt.doNotPerform;
  src.description -> tgt.description;
  src.focus -> tgt.focus;
  src.for -> tgt.for;
  src.encounter -> tgt.encounter;
  src.executionPeriod -> tgt.executionPeriod; // src.requestedPeriod -> tgt.requestedPeriod;
  src.authoredOn -> tgt.authoredOn;
  src.lastModified -> tgt.lastModified;
  src.requester -> tgt.requester;
  src.owner -> tgt.owner; // src.requestedPerformer -> tgt.requestedPerformer;
  src.location -> tgt.location; // src.performer as s -> tgt.performer as t then TaskPerformer(s,t);
  src.reason -> tgt.reasonCode;
  src.insurance -> tgt.insurance;
  src.note -> tgt.note;
  src.relevantHistory -> tgt.relevantHistory;
  src.restriction as s -> tgt.restriction as t then TaskRestriction(s, t);
  src.input as s -> tgt.input as t then TaskInput(s, t);
  src.output as s -> tgt.output as t then TaskOutput(s, t);
}

// group TaskPerformer(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group TaskRestriction(source src, target tgt) extends BackboneElement {
  src.repetitions -> tgt.repetitions;
  src.period -> tgt.period;
  src.recipient -> tgt.recipient;
}

group TaskInput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : integer64 -> tgt.value;
  src.value : markdown -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : CodeableReference -> tgt.value;
  src.value : Coding -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

group TaskOutput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : integer64 -> tgt.value;
  src.value : markdown -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : CodeableReference -> tgt.value;
  src.value : Coding -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

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

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

conceptmap "TaskPriority" {
  prefix s = "http://hl7.org/fhir/request-priority"
  prefix t = "http://hl7.org/fhir/4.3/request-priority"

  s:routine - t:routine
  s:urgent - t:urgent
  s:asap - t:asap
  s:stat - t:stat
}

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

  s:draft - t:draft
  s:requested - t:requested
  s:received - t:received
  s:accepted - t:accepted
  s:rejected - t:rejected
  s:ready - t:ready
  s:cancelled - t:cancelled
  s:"in-progress" - t:"in-progress"
  s:"on-hold" - t:"on-hold"
  s:failed - t:failed
  s:completed - t:completed
  s:"entered-in-error" - t:"entered-in-error"
}

uses "http://hl7.org/fhir/StructureDefinition/Task" alias TaskR5 as source
uses "http://hl7.org/fhir/4.3/StructureDefinition/Task" alias TaskR4B as target

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

group Task(source src : TaskR5, target tgt : TaskR4B) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.instantiatesCanonical;
  src.instantiatesUri -> tgt.instantiatesUri;
  src.basedOn -> tgt.basedOn;
  src.groupIdentifier -> tgt.groupIdentifier;
  src.partOf -> tgt.partOf;
  src.status as v -> tgt.status = translate(v, '#TaskStatus', 'code');
  src.statusReason -> tgt.statusReason;
  src.businessStatus -> tgt.businessStatus;
  src.intent -> tgt.intent;
  src.priority as v -> tgt.priority = translate(v, '#TaskPriority', 'code');
  src.code -> tgt.code; // src.doNotPerform -> tgt.doNotPerform;
  src.description -> tgt.description;
  src.focus -> tgt.focus;
  src.for -> tgt.for;
  src.encounter -> tgt.encounter;
  src.executionPeriod -> tgt.executionPeriod; // src.requestedPeriod -> tgt.requestedPeriod;
  src.authoredOn -> tgt.authoredOn;
  src.lastModified -> tgt.lastModified;
  src.requester -> tgt.requester;
  src.owner -> tgt.owner; // src.requestedPerformer -> tgt.requestedPerformer;
  src.location -> tgt.location; // src.performer as s -> tgt.performer as t then TaskPerformer(s,t);
  src.reason -> tgt.reasonCode;
  src.insurance -> tgt.insurance;
  src.note -> tgt.note;
  src.relevantHistory -> tgt.relevantHistory;
  src.restriction as s -> tgt.restriction as t then TaskRestriction(s, t);
  src.input as s -> tgt.input as t then TaskInput(s, t);
  src.output as s -> tgt.output as t then TaskOutput(s, t);
}

// group TaskPerformer(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group TaskRestriction(source src, target tgt) extends BackboneElement {
  src.repetitions -> tgt.repetitions;
  src.period -> tgt.period;
  src.recipient -> tgt.recipient;
}

group TaskInput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : integer64 -> tgt.value;
  src.value : markdown -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : CodeableReference -> tgt.value;
  src.value : Coding -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

group TaskOutput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : integer64 -> tgt.value;
  src.value : markdown -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : CodeableReference -> tgt.value;
  src.value : Coding -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

Maps from Task

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

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

conceptmap "TaskPriority" {
  prefix s = "http://hl7.org/fhir/4.3/request-priority"
  prefix t = "http://hl7.org/fhir/request-priority"

  s:routine - t:routine
  s:urgent - t:urgent
  s:asap - t:asap
  s:stat - t:stat
}

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

  s:draft - t:draft
  s:requested - t:requested
  s:received - t:received
  s:accepted - t:accepted
  s:rejected - t:rejected
  s:ready - t:ready
  s:cancelled - t:cancelled
  s:"in-progress" - t:"in-progress"
  s:"on-hold" - t:"on-hold"
  s:failed - t:failed
  s:completed - t:completed
  s:"entered-in-error" - t:"entered-in-error"
}

uses "http://hl7.org/fhir/4.3/StructureDefinition/Task" alias TaskR4B as source
uses "http://hl7.org/fhir/StructureDefinition/Task" alias TaskR5 as target

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

group Task(source src : TaskR4B, target tgt : TaskR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.instantiatesCanonical;
  src.instantiatesUri -> tgt.instantiatesUri;
  src.basedOn -> tgt.basedOn;
  src.groupIdentifier -> tgt.groupIdentifier;
  src.partOf -> tgt.partOf;
  src.status as v -> tgt.status = translate(v, '#TaskStatus', 'code');
  src.statusReason -> tgt.statusReason;
  src.businessStatus -> tgt.businessStatus;
  src.intent -> tgt.intent;
  src.priority as v -> tgt.priority = translate(v, '#TaskPriority', 'code');
  src.code -> tgt.code; // src.doNotPerform -> tgt.doNotPerform;
  src.description -> tgt.description;
  src.focus -> tgt.focus;
  src.for -> tgt.for;
  src.encounter -> tgt.encounter;
  src.executionPeriod -> tgt.executionPeriod; // src.requestedPeriod -> tgt.requestedPeriod;
  src.authoredOn -> tgt.authoredOn;
  src.lastModified -> tgt.lastModified;
  src.requester -> tgt.requester;
  src.owner -> tgt.owner; // src.requestedPerformer -> tgt.requestedPerformer;
  src.location -> tgt.location; // src.performer as s -> tgt.performer as t then TaskPerformer(s,t);
  src.reasonCode -> tgt.reason;
  src.insurance -> tgt.insurance;
  src.note -> tgt.note;
  src.relevantHistory -> tgt.relevantHistory;
  src.restriction as s -> tgt.restriction as t then TaskRestriction(s, t);
  src.input as s -> tgt.input as t then TaskInput(s, t);
  src.output as s -> tgt.output as t then TaskOutput(s, t);
}

// group TaskPerformer(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group TaskRestriction(source src, target tgt) extends BackboneElement {
  src.repetitions -> tgt.repetitions;
  src.period -> tgt.period;
  src.recipient -> tgt.recipient;
}

group TaskInput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : markdown -> tgt.value; // src.value : integer64 -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : Coding -> tgt.value; // src.value : CodeableReference -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

group TaskOutput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : markdown -> tgt.value; // src.value : integer64 -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : Coding -> tgt.value; // src.value : CodeableReference -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

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

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

conceptmap "TaskPriority" {
  prefix s = "http://hl7.org/fhir/4.0/request-priority"
  prefix t = "http://hl7.org/fhir/request-priority"

  s:routine - t:routine
  s:urgent - t:urgent
  s:asap - t:asap
  s:stat - t:stat
}

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

  s:draft - t:draft
  s:requested - t:requested
  s:received - t:received
  s:accepted - t:accepted
  s:rejected - t:rejected
  s:ready - t:ready
  s:cancelled - t:cancelled
  s:"in-progress" - t:"in-progress"
  s:"on-hold" - t:"on-hold"
  s:failed - t:failed
  s:completed - t:completed
  s:"entered-in-error" - t:"entered-in-error"
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/Task" alias TaskR4 as source
uses "http://hl7.org/fhir/StructureDefinition/Task" alias TaskR5 as target

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

group Task(source src : TaskR4, target tgt : TaskR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.instantiatesCanonical;
  src.instantiatesUri -> tgt.instantiatesUri;
  src.basedOn -> tgt.basedOn;
  src.groupIdentifier -> tgt.groupIdentifier;
  src.partOf -> tgt.partOf;
  src.status as v -> tgt.status = translate(v, '#TaskStatus', 'code');
  src.statusReason -> tgt.statusReason;
  src.businessStatus -> tgt.businessStatus;
  src.intent -> tgt.intent;
  src.priority as v -> tgt.priority = translate(v, '#TaskPriority', 'code');
  src.code -> tgt.code; // src.doNotPerform -> tgt.doNotPerform;
  src.description -> tgt.description;
  src.focus -> tgt.focus;
  src.for -> tgt.for;
  src.encounter -> tgt.encounter;
  src.executionPeriod -> tgt.executionPeriod; // src.requestedPeriod -> tgt.requestedPeriod;
  src.authoredOn -> tgt.authoredOn;
  src.lastModified -> tgt.lastModified;
  src.requester -> tgt.requester;
  src.owner -> tgt.owner; // src.requestedPerformer -> tgt.requestedPerformer;
  src.location -> tgt.location; // src.performer as s -> tgt.performer as t then TaskPerformer(s,t);
  src.reasonCode -> tgt.reason;
  src.insurance -> tgt.insurance;
  src.note -> tgt.note;
  src.relevantHistory -> tgt.relevantHistory;
  src.restriction as s -> tgt.restriction as t then TaskRestriction(s, t);
  src.input as s -> tgt.input as t then TaskInput(s, t);
  src.output as s -> tgt.output as t then TaskOutput(s, t);
}

// group TaskPerformer(source src, target tgt) extends BackboneElement {
// src.function -> tgt.function;
// src.actor -> tgt.actor;
// }
group TaskRestriction(source src, target tgt) extends BackboneElement {
  src.repetitions -> tgt.repetitions;
  src.period -> tgt.period;
  src.recipient -> tgt.recipient;
}

group TaskInput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : markdown -> tgt.value; // src.value : integer64 -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : Coding -> tgt.value; // src.value : CodeableReference -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}

group TaskOutput(source src, target tgt) extends BackboneElement {
  src.type -> tgt.type;
  src.value : base64Binary -> tgt.value;
  src.value : boolean -> tgt.value;
  src.value : canonical -> tgt.value;
  src.value : code -> tgt.value;
  src.value : date -> tgt.value;
  src.value : dateTime -> tgt.value;
  src.value : decimal -> tgt.value;
  src.value : id -> tgt.value;
  src.value : instant -> tgt.value;
  src.value : integer -> tgt.value;
  src.value : markdown -> tgt.value; // src.value : integer64 -> tgt.value;
  src.value : oid -> tgt.value;
  src.value : positiveInt -> tgt.value;
  src.value : string -> tgt.value;
  src.value : time -> tgt.value;
  src.value : unsignedInt -> tgt.value;
  src.value : uri -> tgt.value;
  src.value : url -> tgt.value;
  src.value : uuid -> tgt.value;
  src.value : Address -> tgt.value;
  src.value : Age -> tgt.value;
  src.value : Annotation -> tgt.value;
  src.value : Attachment -> tgt.value;
  src.value : CodeableConcept -> tgt.value;
  src.value : Coding -> tgt.value; // src.value : CodeableReference -> tgt.value;
  src.value : ContactPoint -> tgt.value;
  src.value : Count -> tgt.value;
  src.value : Distance -> tgt.value;
  src.value : Duration -> tgt.value;
  src.value : HumanName -> tgt.value;
  src.value : Identifier -> tgt.value;
  src.value : Money -> tgt.value;
  src.value : Period -> tgt.value;
  src.value : Quantity -> tgt.value;
  src.value : Range -> tgt.value;
  src.value : Ratio -> tgt.value;
  src.value : Reference -> tgt.value; // src.value : RatioRange -> tgt.value;
  src.value : SampledData -> tgt.value;
  src.value : Signature -> tgt.value;
  src.value : Timing -> tgt.value;
  src.value : ContactDetail -> tgt.value;
  src.value : DataRequirement -> tgt.value;
  src.value : Expression -> tgt.value;
  src.value : ParameterDefinition -> tgt.value;
  src.value : RelatedArtifact -> tgt.value;
  src.value : TriggerDefinition -> tgt.value;
  src.value : UsageContext -> tgt.value;
  src.value : Dosage -> tgt.value; // src.value : Availability -> tgt.value;
  src.value : Meta -> tgt.value;
}