FHIR Release 3 (STU)

This page is part of the FHIR Specification (v3.0.2: STU 3). 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 GroupMaturity Level: N/ABallot Status: InformativeCompartments: Device, Patient, Practitioner

R2 : R3 Converson maps for Specimen.

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

map "http://hl7.org/fhir/StructureMap/Specimen2to3" = "R2 to R3 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"

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

  "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

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

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

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

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