R4 Ballot #1 #2 (Mixed Normative/Trial use)

This page is part of the FHIR Specification (v3.3.0: (v3.5.0: R4 Ballot 2). #2). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

Orders and Observations Work Group Maturity Level : N/A Ballot Status : Informative Compartments : Device , Patient , Practitioner

R2 : R3 : R4 Conversion maps for Specimen.

Functional status for this map: 6 4 tests that all of which 2 fail to execute ok. All tests pass . 2 fail round-trip testing and 1 2 r3 resources are invalid (1 (0 errors). ( see documentation)

map "http://hl7.org/fhir/StructureMap/Specimen2to3" = "R2 to R3 Conversions for Specimen"

map "http://hl7.org/fhir/StructureMap/Specimen3to4" = "R3 to R4 Conversions for Specimen"


uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Specimen" alias SpecimenR2 as source
uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as target


imports "http://hl7.org/fhir/StructureMap/*2to3"

uses "http://hl7.org/fhir/3.0/StructureDefinition/Specimen" alias SpecimenR3 as source
uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as target


group for type+types  Specimen extends DomainResource
  input src : SpecimenR2 as source
  input tgt : Specimen as target

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


  "Specimen-identifier" : for src.identifier make tgt.identifier
  "Specimen-accessionIdentifier" : for src.accessionIdentifier make tgt.accessionIdentifier
  "Specimen-status" : for src.status make tgt.status
  "Specimen-type" : for src.type make tgt.type
  "Specimen-subject" : for src.subject make tgt.subject
  "Specimen-receivedTime" : for src.receivedTime make tgt.receivedTime
  "Specimen-parent" : for src.parent make tgt.parent
  "Specimen-collection" : for src.collection as vs0 make tgt.collection as vt0 then spmCollection(vs0, vt0, tgt)
  "Specimen-treatment" : for src.treatment as vs0 make tgt.processing as vt0 then spmTreatment(vs0, vt0)
  "Specimen-container" : for src.container as vs0 make tgt.container as vt0 then spmContainer(vs0, vt0)
endgroup


group spmCollection extends BackboneElement
  input src as source
  input tgt as target
  input tgts as target


  "Specimen.collection-collector" : for src.collector make tgt.collector
  "Specimen.collection-collected" : for src.collected make tgt.collected 
  "Specimen.collection-comment" : for src.comment make tgts.note 
  "Specimen.collection-quantity" : for src.quantity make tgt.quantity
  "Specimen.collection-method" : for src.method make tgt.method
  "Specimen.collection-bodySite" : for src.bodySite make tgt.bodySite
endgroup

group spmTreatment extends BackboneElement
  input src as source
  input tgt as target

group Specimen extends DomainResource
  input src : SpecimenR3 as source
  input tgt : Specimen as target


  "Specimen.treatment-description" : for src.description make tgt.description
  "Specimen.treatment-procedure" : for src.procedure make tgt.procedure
  "Specimen.treatment-additive" : for src.additive make tgt.additive

  "Specimen.identifier" : for src.identifier as vs make tgt.identifier as vt
  "Specimen.accessionIdentifier" : for src.accessionIdentifier as vs make tgt.accessionIdentifier as vt
  "Specimen.status" : for src.status as vs make tgt.status as vt
  "Specimen.type" : for src.type as vs make tgt.type as vt
  "Specimen.subject" : for src.subject as vs make tgt.subject as vt
  "Specimen.receivedTime" : for src.receivedTime as vs make tgt.receivedTime as vt
  "Specimen.parent" : for src.parent as vs make tgt.parent as vt
  "Specimen.request" : for src.request as vs make tgt.request as vt
  "Specimen.collection" : for src.collection as vs0 make tgt.collection as vt0 then {
    "Specimen.collection.collector" : for vs0.collector as vs make vt0.collector as vt
    "Specimen.collection.collected-dateTime" : for vs0.collected  : dateTime as vs make vt0.collected = create("dateTime") as vt then dateTime(vs,vt)
    "Specimen.collection.collected-Period" : for vs0.collected  : Period as vs make vt0.collected = create("Period") as vt then Period(vs,vt)
    "Specimen.collection.quantity" : for vs0.quantity as vs make vt0.quantity as vt
    "Specimen.collection.method" : for vs0.method as vs make vt0.method as vt
    "Specimen.collection.bodySite" : for vs0.bodySite as vs make vt0.bodySite as vt
  }
  "Specimen.processing" : for src.processing as vs0 make tgt.processing as vt0 then {
    "Specimen.processing.description" : for vs0.description as vs make vt0.description as vt
    "Specimen.processing.procedure" : for vs0.procedure as vs make vt0.procedure as vt
    "Specimen.processing.additive" : for vs0.additive as vs make vt0.additive as vt
    "Specimen.processing.time-dateTime" : for vs0.time  : dateTime as vs make vt0.time = create("dateTime") as vt then dateTime(vs,vt)
    "Specimen.processing.time-Period" : for vs0.time  : Period as vs make vt0.time = create("Period") as vt then Period(vs,vt)
  }
  "Specimen.container" : for src.container as vs0 make tgt.container as vt0 then {
    "Specimen.container.identifier" : for vs0.identifier as vs make vt0.identifier as vt
    "Specimen.container.description" : for vs0.description as vs make vt0.description as vt
    "Specimen.container.type" : for vs0.type as vs make vt0.type as vt
    "Specimen.container.capacity" : for vs0.capacity as vs make vt0.capacity as vt
    "Specimen.container.specimenQuantity" : for vs0.specimenQuantity as vs make vt0.specimenQuantity as vt
    "Specimen.container.additive-CodeableConcept" : for vs0.additive  : CodeableConcept as vs make vt0.additive = create("CodeableConcept") as vt then CodeableConcept(vs,vt)
    "Specimen.container.additive-Reference" : for vs0.additive  : Reference as vs make vt0.additive = create("Reference") as vt then Reference(vs,vt)
  }
  "Specimen.note" : for src.note as vs make tgt.note as vt

endgroup

group spmContainer extends BackboneElement
  input src as source
  input tgt as target

  "Specimen.container-identifier" : for src.identifier make tgt.identifier
  "Specimen.container-description" : for src.description make tgt.description
  "Specimen.container-type" : for src.type make tgt.type
  "Specimen.container-capacity" : for src.capacity make tgt.capacity
  "Specimen.container-specimenQuantity" : for src.specimenQuantity make tgt.specimenQuantity
  "Specimen.container-additive" : for src.additive make tgt.additive 
endgroup


map "http://hl7.org/fhir/StructureMap/Specimen3to2" = "R3 to R2 Conversion for Specimen"

uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Specimen" alias SpecimenR2 as target

map "http://hl7.org/fhir/StructureMap/Specimen4to3" = "R4 to R3 Conversion for Specimen"


imports "http://hl7.org/fhir/StructureMap/*3to2"


group for type+types  Specimen extends DomainResource
  input src : Specimen as source
  input tgt : SpecimenR2 as target

uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as source
uses "http://hl7.org/fhir/3.0/StructureDefinition/Specimen" alias SpecimenR3 as target


  "Specimen-identifier" : for src.identifier make tgt.identifier
  "Specimen-accessionIdentifier" : for src.accessionIdentifier make tgt.accessionIdentifier
  "Specimen-status" : for src.status make tgt.status
  "Specimen-type" : for src.type make tgt.type
  "Specimen-subject" : for src.subject make tgt.subject
  "Specimen-receivedTime" : for src.receivedTime make tgt.receivedTime
  "Specimen-parent" : for src.parent make tgt.parent
  "Specimen-collection" : for src.collection as vs0 make tgt.collection as vt0 then spmCollection(vs0, vt0, src)
  "Specimen-treatment" : for src.processing as vs0 make tgt.treatment as vt0 then spmTreatment(vs0, vt0)
  "Specimen-container" : for src.container as vs0 make tgt.container as vt0 then spmContainer(vs0, vt0)
endgroup

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


group spmCollection extends BackboneElement
  input src as source
  input tgt as target
  input ssrc as source


  "Specimen.collection-collector" : for src.collector make tgt.collector
  "Specimen.collection-collected" : for src.collected make tgt.collected 
  "Specimen.collection-quantity" : for src.quantity make tgt.quantity
  "Specimen.collection-comment" : for ssrc.note make tgt.comment
  "Specimen.collection-method" : for src.method make tgt.method
  "Specimen.collection-bodySite" : for src.bodySite make tgt.bodySite
endgroup


group spmTreatment extends BackboneElement
  input src as source
  input tgt as target

group Specimen extends DomainResource
  input src : Specimen as source
  input tgt : SpecimenR3 as target


  "Specimen.treatment-description" : for src.description make tgt.description
  "Specimen.treatment-procedure" : for src.procedure make tgt.procedure
  "Specimen.treatment-additive" : for src.additive make tgt.additive

  "Specimen.identifier" : for src.identifier as vs make tgt.identifier as vt
  "Specimen.accessionIdentifier" : for src.accessionIdentifier as vs make tgt.accessionIdentifier as vt
  "Specimen.status" : for src.status as vs make tgt.status as vt
  "Specimen.type" : for src.type as vs make tgt.type as vt
  "Specimen.subject" : for src.subject as vs make tgt.subject as vt
  "Specimen.receivedTime" : for src.receivedTime as vs make tgt.receivedTime as vt
  "Specimen.parent" : for src.parent as vs make tgt.parent as vt
  "Specimen.request" : for src.request as vs make tgt.request as vt
  "Specimen.collection" : for src.collection as vs0 make tgt.collection as vt0 then {
    "Specimen.collection.collector" : for vs0.collector as vs make vt0.collector as vt
    "Specimen.collection.collected-dateTime" : for vs0.collected  : dateTime as vs make vt0.collected = create("dateTime") as vt then dateTime(vs,vt)
    "Specimen.collection.collected-Period" : for vs0.collected  : Period as vs make vt0.collected = create("Period") as vt then Period(vs,vt)
    "Specimen.collection.quantity" : for vs0.quantity as vs make vt0.quantity as vt
    "Specimen.collection.method" : for vs0.method as vs make vt0.method as vt
    "Specimen.collection.bodySite" : for vs0.bodySite as vs make vt0.bodySite as vt
  }
  "Specimen.processing" : for src.processing as vs0 make tgt.processing as vt0 then {
    "Specimen.processing.description" : for vs0.description as vs make vt0.description as vt
    "Specimen.processing.procedure" : for vs0.procedure as vs make vt0.procedure as vt
    "Specimen.processing.additive" : for vs0.additive as vs make vt0.additive as vt
    "Specimen.processing.time-dateTime" : for vs0.time  : dateTime as vs make vt0.time = create("dateTime") as vt then dateTime(vs,vt)
    "Specimen.processing.time-Period" : for vs0.time  : Period as vs make vt0.time = create("Period") as vt then Period(vs,vt)
  }
  "Specimen.container" : for src.container as vs0 make tgt.container as vt0 then {
    "Specimen.container.identifier" : for vs0.identifier as vs make vt0.identifier as vt
    "Specimen.container.description" : for vs0.description as vs make vt0.description as vt
    "Specimen.container.type" : for vs0.type as vs make vt0.type as vt
    "Specimen.container.capacity" : for vs0.capacity as vs make vt0.capacity as vt
    "Specimen.container.specimenQuantity" : for vs0.specimenQuantity as vs make vt0.specimenQuantity as vt
    "Specimen.container.additive-CodeableConcept" : for vs0.additive  : CodeableConcept as vs make vt0.additive = create("CodeableConcept") as vt then CodeableConcept(vs,vt)
    "Specimen.container.additive-Reference" : for vs0.additive  : Reference as vs make vt0.additive = create("Reference") as vt then Reference(vs,vt)
  }
  "Specimen.note" : for src.note as vs make tgt.note as vt

endgroup

group spmContainer extends BackboneElement
  input src as source
  input tgt as target

  "Specimen.container-identifier" : for src.identifier make tgt.identifier
  "Specimen.container-description" : for src.description make tgt.description
  "Specimen.container-type" : for src.type make tgt.type
  "Specimen.container-capacity" : for src.capacity make tgt.capacity
  "Specimen.container-specimenQuantity" : for src.specimenQuantity make tgt.specimenQuantity
  "Specimen.container-additive" : for src.additive make tgt.additive 
endgroup


specimen-example ERROR @ Specimen.processing.extension: The extension http://hl7.org/fhir/StructureDefinition/specimen-treatmentTime is unknown, and not allowed here (src = InstanceValidator)