FHIR Release 3 (STU) Current Build
This page is part of FHIR STU 3 (v3.0.1) in it's permanent home (it will always be available at this URL). It has been superceded by R4 . For a full list of available versions, see the Directory of published versions .
Orders and Observations Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Patient Compartments : Device , Patient , Practitioner

R2 : R3 Converson : R4 Conversion maps for Specimen.

Functional status for this map: 6 4 tests that all execute ok. All tests pass 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/3.0/StructureDefinition/Specimen" alias SpecimenR3 as source

uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as target
imports "http://hl7.org/fhir/StructureMap/*2to3"
group for type+types  Specimen extends DomainResource
  input src : SpecimenR2 as source
  input tgt : Specimen 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, 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

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

  "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 Specimen(source src : SpecimenR3, target tgt : Specimen) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.accessionIdentifier -> tgt.accessionIdentifier;
  src.status -> tgt.status;
  src.type -> tgt.type;
  src.subject -> tgt.subject;
  src.receivedTime -> tgt.receivedTime;
  src.parent -> tgt.parent;
  src.request -> tgt.request;
  src.collection as vs0 -> tgt.collection as vt0 then collection(vs0, vt0);
  src.processing as vs0 -> tgt.processing as vt0 then processing(vs0, vt0);
  src.container as vs0 -> tgt.container as vt0 then container(vs0, vt0);
  src.note -> tgt.note;
}

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

group collection(source src, target tgt) extends BackboneElement {
  src.collector -> tgt.collector;
  src.collected : dateTime as vs -> tgt.collected = create('dateTime') as vt then dateTime(vs, vt);
  src.collected : Period as vs -> tgt.collected = create('Period') as vt then Period(vs, vt);
  src.quantity -> tgt.quantity;
  src.method -> tgt.method;
  src.bodySite -> tgt.bodySite;
}

  "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
endgroup

group processing(source src, target tgt) extends BackboneElement {
  src.description -> tgt.description;
  src.procedure -> tgt.procedure;
  src.additive -> tgt.additive;
  src.time : dateTime as vs -> tgt.time = create('dateTime') as vt then dateTime(vs, vt);
  src.time : Period as vs -> tgt.time = create('Period') as vt then Period(vs, vt);
}

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

group container(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.description -> tgt.description;
  src.type -> tgt.type;
  src.capacity -> tgt.capacity;
  src.specimenQuantity -> tgt.specimenQuantity;
  src.additive : CodeableConcept as vs -> tgt.additive = create('CodeableConcept') as vt then CodeableConcept(vs, vt);
  src.additive : Reference as vs -> tgt.additive = create('Reference') as vt then Reference(vs, vt);
}

  "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"
map "http://hl7.org/fhir/StructureMap/Specimen4to3" = "R4 to R3 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
imports "http://hl7.org/fhir/StructureMap/*3to2"
group for type+types  Specimen extends DomainResource
  input src : Specimen as source
  input tgt : SpecimenR2 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

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

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

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

  "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 Specimen(source src : Specimen, target tgt : SpecimenR3) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.accessionIdentifier -> tgt.accessionIdentifier;
  src.status -> tgt.status;
  src.type -> tgt.type;
  src.subject -> tgt.subject;
  src.receivedTime -> tgt.receivedTime;
  src.parent -> tgt.parent;
  src.request -> tgt.request;
  src.collection as vs0 -> tgt.collection as vt0 then collection(vs0, vt0);
  src.processing as vs0 -> tgt.processing as vt0 then processing(vs0, vt0);
  src.container as vs0 -> tgt.container as vt0 then container(vs0, vt0);
  src.note -> tgt.note;
}

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

group collection(source src, target tgt) extends BackboneElement {
  src.collector -> tgt.collector;
  src.collected : dateTime as vs -> tgt.collected = create('dateTime') as vt then dateTime(vs, vt);
  src.collected : Period as vs -> tgt.collected = create('Period') as vt then Period(vs, vt);
  src.quantity -> tgt.quantity;
  src.method -> tgt.method;
  src.bodySite -> tgt.bodySite;
}

  "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
endgroup

group processing(source src, target tgt) extends BackboneElement {
  src.description -> tgt.description;
  src.procedure -> tgt.procedure;
  src.additive -> tgt.additive;
  src.time : dateTime as vs -> tgt.time = create('dateTime') as vt then dateTime(vs, vt);
  src.time : Period as vs -> tgt.time = create('Period') as vt then Period(vs, vt);
}

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

group container(source src, target tgt) extends BackboneElement {
  src.identifier -> tgt.identifier;
  src.description -> tgt.description;
  src.type -> tgt.type;
  src.capacity -> tgt.capacity;
  src.specimenQuantity -> tgt.specimenQuantity;
  src.additive : CodeableConcept as vs -> tgt.additive = create('CodeableConcept') as vt then CodeableConcept(vs, vt);
  src.additive : Reference as vs -> tgt.additive = create('Reference') as vt then Reference(vs, vt);
}

  "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) <p>No validation errors - all conversions are clean</p>