cda2fhirMedPrescription
type: StructureMap
node role: treeRoot
id:
  v: cda2fhirMedPrescription
text:
  status:
    v: generated
  div: map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirMedPrescription" = "cda2fhirMedPrescription" uses "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument" alias ClinicalDocument as source uses "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor" alias AssignedAuthor as queried uses "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity" alias AssignedEntity as queried uses "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity" alias AssociatedEntity as queried uses "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization" alias CustodianOrganization as queried uses "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf" alias OrganizationPartOf as queried uses "http://hl7.org/fhir/cda/StructureDefinition/Organization" alias rapresentedOrganization as queried uses "http://hl7.org/fhir/cda/StructureDefinition/Section" alias Section as queried uses "http://hl7.org/fhir/cda/StructureDefinition/PatientRole" alias PatientRole as queried uses "http://hl7.org/fhir/cda/StructureDefinition/AD" alias AD as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target uses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as produced uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as produced uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as produced uses "http://hl7.org/fhir/StructureDefinition/Person" alias Patient as produced uses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced uses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced uses "http://hl7.org/fhir/cda/StructureDefinition/Act" alias Act as produced uses "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ" alias IVL_PQ as source uses "http://hl7.org/fhir/cda/StructureDefinition/PQ" alias PQ as source uses "http://hl7.org/fhir/StructureDefinition/SimpleQuantity" alias SimpleQuantity as target imports "htt…
url:
  v: http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirMedPrescription
version:
  v: 0.1.0
name:
  v: cda2fhirMedPrescription
status:
  v: draft
date:
  v: 2025-10-01T07:14:02+00:00
publisher:
  v: HL7 Italy
contact:
  name:
    v: HL7 Italy
  telecom:
    system:
      v: url
    value:
      v: http://hl7.it
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
    code:
      v: IT
    display:
      v: Italy
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument
    link: http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument
  mode:
    v: source
  alias:
    v: ClinicalDocument
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor
    link: http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor
  mode:
    v: queried
  alias:
    v: AssignedAuthor
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity
    link: http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity
  mode:
    v: queried
  alias:
    v: AssignedEntity
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity
    link: http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity
  mode:
    v: queried
  alias:
    v: AssociatedEntity
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization
    link: http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization
  mode:
    v: queried
  alias:
    v: CustodianOrganization
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf
    link: http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf
  mode:
    v: queried
  alias:
    v: OrganizationPartOf
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/Organization
    link: http://hl7.org/fhir/cda/StructureDefinition/Organization
  mode:
    v: queried
  alias:
    v: rapresentedOrganization
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/Section
    link: http://hl7.org/fhir/cda/StructureDefinition/Section
  mode:
    v: queried
  alias:
    v: Section
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/PatientRole
    link: http://hl7.org/fhir/cda/StructureDefinition/PatientRole
  mode:
    v: queried
  alias:
    v: PatientRole
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/AD
    link: http://hl7.org/fhir/cda/StructureDefinition/AD
  mode:
    v: source
  alias:
    v: AD
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Bundle
    link: http://hl7.org/fhir/StructureDefinition/Bundle
  mode:
    v: target
  alias:
    v: Bundle
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Composition
    link: http://hl7.org/fhir/StructureDefinition/Composition
  mode:
    v: produced
  alias:
    v: Composition
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    link: http://hl7.org/fhir/StructureDefinition/Patient
  mode:
    v: produced
  alias:
    v: Patient
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Encounter
    link: http://hl7.org/fhir/StructureDefinition/Encounter
  mode:
    v: produced
  alias:
    v: Encounter
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Person
    link: http://hl7.org/fhir/StructureDefinition/Person
  mode:
    v: produced
  alias:
    v: Patient
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    link: http://hl7.org/fhir/StructureDefinition/Practitioner
  mode:
    v: produced
  alias:
    v: Practitioner
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Organization
    link: http://hl7.org/fhir/StructureDefinition/Organization
  mode:
    v: produced
  alias:
    v: Organization
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/Act
    link: http://hl7.org/fhir/cda/StructureDefinition/Act
  mode:
    v: produced
  alias:
    v: Act
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ
    link: http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ
  mode:
    v: source
  alias:
    v: IVL_PQ
structure:
  url:
    v: http://hl7.org/fhir/cda/StructureDefinition/PQ
    link: http://hl7.org/fhir/cda/StructureDefinition/PQ
  mode:
    v: source
  alias:
    v: PQ
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    link: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
  mode:
    v: target

v: SimpleQuantity

name:
  v: CdaToBundle
type mode:
  v: none
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: ClinicalDocumentToBody
  source:
    context:
      v: cda
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: request
    variable:
      v: request
    transform:
      v: create
    parameter:
      value: string
        v: BackboneElement
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: string
        v: POST
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: composition
    transform:
      v: create
    parameter:
      value: string
        v: Composition
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid1
    transform:
      v: uuid
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: https://example/Composition/
    parameter:
      value: id
        v: uuid1
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: Composition
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e2
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: request
    variable:
      v: requestPAT
    transform:
      v: create
    parameter:
      value: string
        v: BackboneElement
  target:
    context:
      v: requestPAT
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: string
        v: PUT
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: patient
    transform:
      v: create
    parameter:
      value: string
        v: Patient
  target:
    context:
      v: patient
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid2
    transform:
      v: uuid
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: https://example/Patient/
    parameter:
      value: id
        v: uuid2
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e3
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: request

v: request

v: create

value: string
  v: BackboneElement

context:
  v: request
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: string
    v: POST

context:
  v: e3
context type:
  v: variable
element:
  v: resource
variable:
  v: encounter
transform:
  v: create
parameter:
  value: string
    v: Encounter

context:
  v: encounter
context type:
  v: variable
element:
  v: id
variable:
  v: uuid3
transform:
  v: uuid

context:
  v: e3
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: https://example/Encounter/
parameter:
  value: id
    v: uuid3

context:
  v: request
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: Encounter

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: e5

context:
  v: e5
context type:
  v: variable
element:
  v: request
variable:
  v: request
transform:
  v: create
parameter:
  value: string
    v: BackboneElement

context:
  v: request
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: string
    v: POST

context:
  v: e5
context type:
  v: variable
element:
  v: resource
variable:
  v: DocumentReference
transform:
  v: create
parameter:
  value: string
    v: DocumentReference

context:
  v: DocumentReference
context type:
  v: variable
element:
  v: id
variable:
  v: uuid5
transform:
  v: uuid

context:
  v: e5
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: https://example/DocumentReference/
parameter:
  value: id
    v: uuid5

context:
  v: request
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: DocumentReference

name:
  v: cdatobundle
source:
  context:
    v: cda
dependent:
  name:
    v: ClinicalDocumentToBundle
  variable:
    v: cda
  variable:
    v: patient
  variable:
    v: composition
  variable:
    v: encounter
  variable:
    v: bundle
  variable:
    v: DocumentReference

name:
  v: patient
source:
  context:
    v: cda
  element:
    v: recordTarget
  variable:
    v: recordTarget
rule:
  name:
    v: recPat
  source:
    context:
      v: recordTarget
    element:
      v: patientRole
    variable:
      v: patient
  rule:
    name:
      v: record
    source:
      context:
        v: patient
      element:
        v: id
      variable:
        v: id
    target:
      context:
        v: patient
      context type:
        v: variable
      element:
        v: identifier
      variable:
        v: identifier
    rule:
      name:
        v: root1
    rule:
      name:
        v: extension
    rule:
      name:
        v: assigningAuthorityName
  rule:
    name:
      v: ext
    source:
      context:
        v: patient
      element:
        v: id
      variable:
        v: id
      condition:
        v: (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.…
    rule:
      name:
        v: UUID

v: id

v: root

v: r

v: identifier

v: variable

v: system

v: translate

value: id
  v: r

value: string
  v: uri

v: id

v: extension

v: ext

v: identifier

v: variable

v: value

v: copy

value: id
  v: ext

v: id

v: assigningAuthorityName

v: s

v: identifier

v: variable

v: assigner

v: a

v: a

v: variable

v: display

v: copy

value: id
  v: s

v: id

v: extension

v: ext

v: requestPAT

v: variable

v: url

v: append

value: string
  v: Patient?identifier=

value: id
  v: ext

name:
  v: ClinicalDocumentToBundle
type mode:
  v: none
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
input:
  name:
    v: encounter
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: DocumentReference
  type:
    v: DocumentReference
  mode:
    v: target
rule:
  name:
    v: id
  source:
    context:
      v: cda
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: identifier
  source:
    context:
      v: cda
    element:
      v: id
    variable:
      v: vvv
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: type
  source:
    context:
      v: cda
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: type
    transform:
      v: copy
    parameter:
      value: string
        v: transaction
rule:
  name:
    v: date
  source:
    context:
      v: cda
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: timestamp
    transform:
      v: evaluate
    parameter:
      value: string
        v: timestamp.now()
rule:
  name:
    v: composition
  source:
    context:
      v: cda
  dependent:
    name:
      v: ClinicalDocumentComposition
    variable:
      v: cda
    variable:
      v: composition
    variable:
      v: patient
    variable:
      v: encounter
    variable:
      v: bundle
    variable:
      v: DocumentReference
rule:
  name:
    v: component
  source:
    context:
      v: cda
    element:
      v: component
    variable:
      v: component
  rule:
    name:
      v: body
    source:
      context:
        v: component
      element:
        v: structuredBody
      variable:
        v: body
    rule:
      name:
        v: coverage

v: body

v: bundle

v: variable

v: entry

v: e1

v: e1

v: variable

v: request

v: request

v: create

value: string
  v: BackboneElement

v: request

v: variable

v: method

v: copy

value: string
  v: POST

v: e1

v: variable

v: resource

v: coverage

v: create

value: string
  v: Coverage

v: coverage

v: variable

v: id

v: uuid1

v: uuid

v: e1

v: variable

v: fullUrl

v: append

value: id
  v: uuid1

v: request

v: variable

v: url

v: copy

value: string
  v: Coverage

v: medreq

context:
  v: body

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: e2

context:
  v: e2
context type:
  v: variable
element:
  v: request
variable:
  v: request
transform:
  v: create
parameter:
  value: string
    v: BackboneElement

context:
  v: request
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: string
    v: POST

context:
  v: e2
context type:
  v: variable
element:
  v: resource
variable:
  v: medRq
transform:
  v: create
parameter:
  value: string
    v: MedicationRequest

context:
  v: medRq
context type:
  v: variable
element:
  v: id
variable:
  v: uuid1
transform:
  v: uuid

context:
  v: e2
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: https://example/MedicationRequest/
parameter:
  value: id
    v: uuid1

context:
  v: request
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: MedicationRequest

name:
  v: component
source:
  context:
    v: body
  element:
    v: component
  variable:
    v: component
rule:
  name:
    v: cov
  source:
    context:
      v: component
    element:
      v: section
    variable:
      v: srcSection
  rule:
    name:
      v: esenz
    source:
      context:
        v: srcSection
      element:
        v: code
      condition:
        v: (code = '57827-8')
    target:
      context:
        v: composition
      context type:
        v: variable
      element:
        v: section
      variable:
        v: tgtSection
    dependent:
      name:
        v: ClinicalDocumentSectionEsenzioni
      variable:
        v: cda
      variable:
        v: srcSection
      variable:
        v: patient
      variable:
        v: tgtSection
      variable:
        v: bundle
      variable:
        v: encounter
      variable:
        v: coverage
  rule:
    name:
      v: prescfarm
    source:
      context:
        v: srcSection
      element:
        v: code
      condition:
        v: (code = '57828-6')
    target:
      context:
        v: composition
      context type:
        v: variable
      element:
        v: section
      variable:
        v: tgtSection
    dependent:
      name:
        v: ClinicalDocumentSectionPrescrizioneFarmaceutica
      variable:
        v: cda
      variable:
        v: srcSection
      variable:
        v: patient
      variable:
        v: tgtSection
      variable:
        v: bundle
      variable:
        v: encounter
      variable:
        v: coverage
      variable:
        v: medRq
  rule:
    name:
      v: annot
    source:
      context:
        v: srcSection
      element:
        v: code
      condition:
        v: (code = '48767-8')
    target:
      context:
        v: composition
      context type:
        v: variable
      element:
        v: section
      variable:
        v: tgtSection
    dependent:
      name:
        v: ClinicalDocumentSectionAnnotazioni
      variable:
        v: cda
      variable:
        v: srcSection
      variable:
        v: patient
      variable:
        v: tgtSection
      variable:
        v: bundle
      variable:
        v: encounter
      variable:
        v: medRq
  rule:
    name:
      v: messregg
    source:
      context:
        v: srcSection
      element:
        v: code
      condition:
        v: (code = '51851-4')
    target:
      context:
        v: composition
      context type:
        v: variable
      element:
        v: section
      variable:
        v: tgtSection
    dependent:
      name:
        v: ClinicalDocumentSectionMessaggioRegionale
      variable:
        v: cda
      variable:
        v: srcSection
      variable:
        v: patient
      variable:
        v: tgtSection
      variable:
        v: bundle
      variable:
        v: encounter
      variable:
        v: medRq
  rule:
    name:
      v: paramvit
    source:
      context:
        v: srcSection
      element:
        v: code
      condition:
        v: (code = '8716-3')
    target:
      context:
        v: composition
      context type:
        v: variable
      element:
        v: section
      variable:
        v: tgtSection
    dependent:
      name:
        v: ClinicalDocumentSectionParametriVitali
      variable:
        v: cda
      variable:
        v: srcSection
      variable:
        v: patient
      variable:
        v: tgtSection
      variable:
        v: bundle
      variable:
        v: encounter
  rule:
    name:
      v: allergfarm

context:
  v: srcSection
element:
  v: code
condition:
  v: (code = '48765-2')

context:
  v: composition
context type:
  v: variable
element:
  v: section
variable:
  v: tgtSection

name:
  v: ClinicalDocumentSectionAllergieaiFarmaci
variable:
  v: cda
variable:
  v: srcSection
variable:
  v: patient
variable:
  v: tgtSection
variable:
  v: bundle
variable:
  v: encounter

name:
  v: statclinpaz
source:
  context:
    v: srcSection
  element:
    v: code
  condition:
    v: (code = '47420-5')
target:
  context:
    v: composition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: tgtSection
dependent:
  name:
    v: ClinicalDocumentSectionStatoClinicoPaziente
  variable:
    v: cda
  variable:
    v: srcSection
  variable:
    v: patient
  variable:
    v: tgtSection
  variable:
    v: bundle
  variable:
    v: encounter

v: discretizzi il primo livello di component

name:
  v: ClinicalDocumentSectionEsenzioni
type mode:
  v: none
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: coverage
  type:
    v: Coverage
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: cff
  source:
    context:
      v: src
    element:
      v: text
    variable:
      v: cdaText
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'https://example/Coverage/' + %coverage.id
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: text
    variable:
      v: fhirText
  rule:
    name:
      v: narrativeStatus
    source:
      context:
        v: cdaText
    target:
      context:
        v: fhirText
      context type:
        v: variable
      element:
        v: status
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: narrativeText
    source:
      context:
        v: cdaText
      variable:
        v: t
    target:
      context:
        v: fhirText
      context type:
        v: variable
      element:
        v: div
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: secact
    source:
      context:
        v: src
      element:
        v: entry
      variable:
        v: srcse
    rule:
      name:
        v: cdaText

string
v: generated

id
v: t

v: srcse

v: act

v: srcsec

v: code

context:
  v: srcsec
element:
  v: code
variable:
  v: vvv

context:
  v: coverage
context type:
  v: variable
element:
  v: type
variable:
  v: vvv
transform:
  v: create

v: origtxt

context:
  v: srcsec
element:
  v: code
variable:
  v: srctxt

name:
  v: reftxt
source:
  context:
    v: srctxt
target:
  context:
    v: coverage
  context type:
    v: variable
  element:
    v: type
  variable:
    v: typetxt
rule:
  name:
    v: rfde
  source:
    context:
      v: srctxt
    element:
      v: originalText
    variable:
      v: ref
  rule:
    name:
      v: tcf
    source:
      context:
        v: ref
      element:
        v: reference
      variable:
        v: t
    rule:
      name:
        v: reference

v: t

v: value

v: l

v: typetxt

v: variable

v: text

v: copy

value: id
  v: l

v: statuscode

context:
  v: srcsec
condition:
  v: coverage.status.exists().not()

name:
  v: status
source:
  context:
    v: srcsec
target:
  context:
    v: coverage
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: active

v: reference

context:
  v: srcsec

context:
  v: coverage
context type:
  v: variable
element:
  v: beneficiary
variable:
  v: reference
transform:
  v: create
parameter:
  value: string
    v: Reference

context:
  v: reference
context type:
  v: variable
element:
  v: reference
transform:
  v: evaluate
parameter:
  value: string
    v: 'https://example/Patient/' + %patient.id

v: reference

context:
  v: srcsec

context:
  v: coverage
context type:
  v: variable
element:
  v: payor
variable:
  v: reference
transform:
  v: create
parameter:
  value: string
    v: Reference

context:
  v: reference
context type:
  v: variable
element:
  v: reference
transform:
  v: evaluate
parameter:
  value: string
    v: 'https://example/Patient/' + %patient.id

name:
  v: ClinicalDocumentSectionPrescrizioneFarmaceutica
type mode:
  v: none
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: coverage
  type:
    v: Coverage
  mode:
    v: target
input:
  name:
    v: medRq
  type:
    v: MedicationRequest
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: xxx
  source:
    context:
      v: src
    element:
      v: text
    variable:
      v: cdaText
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'https://example/MedicationRequest/' + %medRq.id
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: text
    variable:
      v: fhirText
  rule:
    name:
      v: id
    source:
      context:
        v: src
      element:
        v: id
      variable:
        v: vvv
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: identifier
      variable:
        v: vvv
      transform:
        v: create
  rule:
    name:
      v: narrativeStatus
    source:
      context:
        v: cdaText
    target:
      context:
        v: fhirText
      context type:
        v: variable
      element:
        v: status
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: narrativeText
    source:
      context:
        v: cdaText
      variable:
        v: t
    target:
      context:
        v: fhirText
      context type:
        v: variable
      element:
        v: div
      transform:
        v: copy
      parameter:
        value: id

string
v: generated

id
v: t

name:
  v: reference
source:
  context:
    v: cdaText
target:
  context:
    v: medRq
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Patient/' + %patient.id

name:
  v: reference
source:
  context:
    v: cdaText
target:
  context:
    v: medRq
  context type:
    v: variable
  element:
    v: encounter
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Encounter/' + %enc.id

name:
  v: status
source:
  context:
    v: cdaText
target:
  context:
    v: medRq
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: active

name:
  v: intent
source:
  context:
    v: cdaText
target:
  context:
    v: medRq
  context type:
    v: variable
  element:
    v: intent
  transform:
    v: copy
  parameter:
    value: string
      v: order

name:
  v: hnjh
source:
  context:
    v: src
  element:
    v: entry
  variable:
    v: srcent
rule:
  name:
    v: subadm
  source:
    context:
      v: srcent
    element:
      v: substanceAdministration
    variable:
      v: subAdm
  rule:
    name:
      v: dosage
    source:
      context:
        v: subAdm
      type:
        v: IVL_TS
      element:
        v: effectiveTime
      variable:
        v: eff
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: dosageInstruction
      variable:
        v: dosage
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: timing
  rule:
    name:
      v: dosage1
    source:
      context:
        v: subAdm
      element:
        v: effectiveTime
      variable:
        v: eff
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: dosageInstruction
      variable:
        v: dosage
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: timing1
  rule:
    name:
      v: eff
    source:
      context:
        v: subAdm
      type:
        v: PIVL_TS
      element:
        v: effectiveTime
      variable:
        v: effp
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: dosageInstruction
      variable:
        v: dosage
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: timing
  rule:
    name:
      v: eff
    source:
      context:
        v: subAdm
      type:
        v: EIVL_TS
      element:
        v: effectiveTime
      variable:
        v: effe
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: dosageInstruction
      variable:
        v: dosage
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: ghj
  rule:
    name:
      v: doseQuant
    source:
      context:
        v: subAdm
      element:
        v: doseQuantity
      variable:
        v: doseQuant
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: dosageInstruction
      variable:
        v: dosage
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: ot
    rule:
      name:
        v: dosageRate
  rule:
    name:
      v: subsadm
    source:
      context:
        v: subAdm
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: e1
    target:
      context:
        v: e1
      context type:
        v: variable
      element:
        v: request
      variable:
        v: request
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: request
      context type:
        v: variable
      element:
        v: method
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: e1
      context type:
        v: variable
      element:
        v: resource

string
v: Dosage

v: subAdm

v: dosage

v: variable

v: timing

v: tim

v: create

value: string
  v: Timing

v: repeat

context:
  v: subAdm

context:
  v: tim
context type:
  v: variable
element:
  v: repeat
variable:
  v: repeat

name:
  v: boundsperiod
source:
  context:
    v: eff
target:
  context:
    v: repeat
  context type:
    v: variable
  element:
    v: bounds
  variable:
    v: period
  transform:
    v: create
  parameter:
    value: string
      v: Period
dependent:
  name:
    v: IVLTSPeriod
  variable:
    v: eff
  variable:
    v: period

name:
  v: width
source:
  context:
    v: eff
  element:
    v: width
  variable:
    v: width
rule:
  name:
    v: value
  source:
    context:
      v: width
    element:
      v: value
    variable:
      v: v
  target:
    context:
      v: repeat
    context type:
      v: variable
    element:
      v: duration
    transform:
      v: copy
    parameter:
      value: id
        v: v
rule:
  name:
    v: unit
  source:
    context:
      v: width
    element:
      v: unit
    variable:
      v: u
  target:
    context:
      v: repeat
    context type:
      v: variable
    element:
      v: durationUnit
    transform:
      v: copy
    parameter:
      value: id
        v: u

string
v: Dosage

v: subAdm

v: dosage

v: variable

v: timing

v: tim

v: create

value: string
  v: Timing

v: effct1

context:
  v: eff
condition:
  v: eff.low.exists().not() and eff.high.exists().not()

name:
  v: evnt
source:
  context:
    v: eff
  element:
    v: value
  variable:
    v: v
target:
  context:
    v: tim
  context type:
    v: variable
  element:
    v: event
  variable:
    v: event
  transform:
    v: create
  parameter:
    value: string
      v: dateTime
dependent:
  name:
    v: TSDateTime
  variable:
    v: v
  variable:
    v: event

string
v: Dosage

v: effp

v: dosage

v: variable

v: timing

v: timing

v: create

value: string
  v: Timing

v: cod

context:
  v: effp

context type:
  v: variable
transform:
  v: copy
parameter:
  value: id
    v: timing

name:
  v: periodTiming
variable:
  v: effp
variable:
  v: timing

v: phase

context:
  v: effp
condition:
  v: effp.phase.exists()

name:
  v: rep
source:
  context:
    v: effp
  element:
    v: phase
  variable:
    v: phase
target:
  context:
    v: timing
  context type:
    v: variable
  element:
    v: repeat
  variable:
    v: r
rule:
  name:
    v: low
  source:
    context:
      v: phase
    element:
      v: low
  target:
    context:
      v: r
    context type:
      v: variable
    element:
      v: bounds
    variable:
      v: period
    transform:
      v: create
    parameter:
      value: string
        v: Period
  rule:
    name:
      v: lo
    source:
      context:
        v: phase
      element:
        v: low
      variable:
        v: vvv
    target:
      context:
        v: period
      context type:
        v: variable
      element:
        v: start
      variable:
        v: vvv
      transform:
        v: create
rule:
  name:
    v: dur
  source:
    context:
      v: phase
    element:
      v: width
    variable:
      v: wid
  rule:
    name:
      v: vals
    source:
      context:
        v: wid
      element:
        v: value
      variable:
        v: v
    target:
      context:
        v: r
      context type:
        v: variable
      element:
        v: duration
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: unit
    source:
      context:
        v: wid
      element:
        v: unit
      variable:
        v: u
    target:
      context:
        v: r
      context type:
        v: variable
      element:
        v: durationUnit
      transform:
        v: copy
      parameter:
        value: id

id
v: v

id
v: u

string
v: Dosage

v: effe

v: dosage

v: variable

v: timing

v: timing

v: create

value: string
  v: Timing

v: lkj

context:
  v: effe

context:
  v: timing
context type:
  v: variable
element:
  v: repeat
variable:
  v: r

name:
  v: event
source:
  context:
    v: effe
  element:
    v: event
  variable:
    v: vvv
target:
  context:
    v: r
  context type:
    v: variable
  element:
    v: when
  variable:
    v: vvv
  transform:
    v: create

name:
  v: poi
source:
  context:
    v: effe
  element:
    v: offset
  variable:
    v: offset
rule:
  name:
    v: offs
  source:
    context:
      v: offset
    element:
      v: low
    variable:
      v: v
  rule:
    name:
      v: barabar
    source:
      context:
        v: v
      element:
        v: value
      variable:
        v: o
    target:
      context:
        v: r
      context type:
        v: variable
      element:
        v: offset
      transform:
        v: copy
      parameter:
        value: id

id
v: o

string
v: Dosage

v: doseQuant

v: originalText

v: ot

v: reference

context:
  v: ot
element:
  v: reference
variable:
  v: vvv

context:
  v: dosage
context type:
  v: variable
element:
  v: text
variable:
  v: vvv
transform:
  v: create

v: doseQuant

v: dosage

v: variable

v: doseAndRate

v: dosageRate

v: d

context:
  v: doseQuant

context:
  v: dosageRate
context type:
  v: variable
element:
  v: dose
variable:
  v: d
transform:
  v: create
parameter:
  value: string
    v: Range

name:
  v: low
source:
  context:
    v: doseQuant
target:
  context:
    v: d
  context type:
    v: variable
  element:
    v: low
  variable:
    v: l
  transform:
    v: create
  parameter:
    value: string
      v: SimpleQuantity
rule:
  name:
    v: low
  source:
    context:
      v: doseQuant
    element:
      v: low
    variable:
      v: lo
  target:
    context:
      v: l
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: lo.value
rule:
  name:
    v: low
  source:
    context:
      v: doseQuant
    element:
      v: low
    variable:
      v: lo
  target:
    context:
      v: l
    context type:
      v: variable
    element:
      v: unit
    transform:
      v: evaluate
    parameter:
      value: string
        v: lo.unit

name:
  v: low
source:
  context:
    v: doseQuant
target:
  context:
    v: d
  context type:
    v: variable
  element:
    v: high
  variable:
    v: h
  transform:
    v: create
  parameter:
    value: string
      v: SimpleQuantity
rule:
  name:
    v: high
  source:
    context:
      v: doseQuant
    element:
      v: high
    variable:
      v: hi
  target:
    context:
      v: h
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: hi.value
rule:
  name:
    v: high
  source:
    context:
      v: doseQuant
    element:
      v: high
    variable:
      v: hi
  target:
    context:
      v: h
    context type:
      v: variable
    element:
      v: unit
    transform:
      v: evaluate
    parameter:
      value: string
        v: hi.unit

string
v: BackboneElement

string
v: POST

v: medication

v: create

value: string
  v: Medication

context:
  v: medication
context type:
  v: variable
element:
  v: id
variable:
  v: uuid1
transform:
  v: uuid

context:
  v: e1
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: https://example/Medication/
parameter:
  value: id
    v: uuid1

context:
  v: request
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: Medication

context:
  v: medRq
context type:
  v: variable
element:
  v: medication
variable:
  v: reference
transform:
  v: create
parameter:
  value: string
    v: Reference

context:
  v: reference
context type:
  v: variable
element:
  v: reference
transform:
  v: evaluate
parameter:
  value: string
    v: 'https://example/Medication/' + %medication.id

name:
  v: cons
source:
  context:
    v: subAdm
  element:
    v: consumable
  variable:
    v: cons
rule:
  name:
    v: manumat
  source:
    context:
      v: cons
    element:
      v: manufacturedProduct
    variable:
      v: manuprod
  rule:
    name:
      v: manudrug
    source:
      context:
        v: manuprod
      element:
        v: manufacturedLabeledDrug
      variable:
        v: manudrug
    rule:
      name:
        v: code
    rule:
      name:
        v: idmedname
    rule:
      name:
        v: origtxtd
  rule:
    name:
      v: manuFact
    source:
      context:
        v: manuprod
      element:
        v: manufacturedMaterial
      variable:
        v: manufact
    rule:
      name:
        v: code
    rule:
      name:
        v: origtxt
    rule:
      name:
        v: ingr
    rule:
      name:
        v: formCode
    rule:
      name:
        v: transl

v: manudrug

v: code

v: vvv

v: medication

v: variable

v: code

v: vvv

v: create

v: manudrug

v: medication

v: variable

v: identifier

v: medid

v: name

context:
  v: manudrug
element:
  v: name
variable:
  v: vvv

context:
  v: medid
context type:
  v: variable
element:
  v: value
variable:
  v: vvv
transform:
  v: create

v: manudrug

v: code

v: srctxt

v: reftxtd

context:
  v: srctxt

context:
  v: medication
context type:
  v: variable
element:
  v: code
variable:
  v: typetxt

name:
  v: tcfg
source:
  context:
    v: srctxt
  element:
    v: originalText
  variable:
    v: ref
rule:
  name:
    v: tcf
  source:
    context:
      v: ref
    element:
      v: reference
    variable:
      v: reference
  rule:
    name:
      v: reference
    source:
      context:
        v: reference
      element:
        v: value
      variable:
        v: l
    target:
      context:
        v: typetxt
      context type:
        v: variable
      element:
        v: text
      transform:
        v: copy
      parameter:
        value: id

id
v: l

v: manufact

v: code

v: vvv

v: medication

v: variable

v: code

v: vvv

v: create

v: manufact

v: code

v: srctxt

v: reftxt

context:
  v: srctxt

context:
  v: medication
context type:
  v: variable
element:
  v: code
variable:
  v: typetxt

name:
  v: tcfg
source:
  context:
    v: srctxt
  element:
    v: originalText
  variable:
    v: ref
rule:
  name:
    v: tcf
  source:
    context:
      v: ref
    element:
      v: reference
    variable:
      v: reference
  rule:
    name:
      v: reference
    source:
      context:
        v: reference
      element:
        v: value
      variable:
        v: l
    target:
      context:
        v: typetxt
      context type:
        v: variable
      element:
        v: text
      transform:
        v: copy
      parameter:
        value: id

id
v: l

v: manufact

v: ingredient

v: ingredient

v: medication

v: variable

v: ingredient

v: ing

v: strength

context:
  v: ingredient
element:
  v: quantity
variable:
  v: quantity

context:
  v: ing
context type:
  v: variable
element:
  v: strength
variable:
  v: strength
transform:
  v: create
parameter:
  value: string
    v: Ratio

name:
  v: EmedRTOPQPQRatio
variable:
  v: quantity
variable:
  v: strength

v: ingredientCode

context:
  v: manufact

context:
  v: ing
context type:
  v: variable
element:
  v: item
variable:
  v: ingcode
transform:
  v: create
parameter:
  value: string
    v: CodeableConcept

context:
  v: ingcode
context type:
  v: variable
element:
  v: text
transform:
  v: evaluate
parameter:
  value: string
    v: %manufact.name.other

v: manufact

v: formCode

v: vvv

v: medication

v: variable

v: form

v: vvv

v: create

v: manufact

v: medication

v: variable

v: identifier

v: medid

name:
  v: entry1
source:
  context:
    v: subAdm
  element:
    v: entryRelationship
  variable:
    v: entryrel1
rule:
  name:
    v: supply
  source:
    context:
      v: entryrel1
    element:
      v: supply
    variable:
      v: sup
  target:
    context:
      v: medRq
    context type:
      v: variable
    element:
      v: dispenseRequest
    variable:
      v: dispreq
  rule:
    name:
      v: quantity
    source:
      context:
        v: sup
    target:
      context:
        v: dispreq
      context type:
        v: variable
      element:
        v: quantity
      variable:
        v: quantity
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: quantity

string
v: SimpleQuantity

v: sup

v: quantity

v: q

v: quantity

v: variable

v: value

v: evaluate

value: string
  v: q.value

name:
  v: entry2
source:
  context:
    v: subAdm
  element:
    v: entryRelationship
  variable:
    v: entryrel2
  condition:
    v: (typeCode = 'REFR')
rule:
  name:
    v: Cover
  source:
    context:
      v: subAdm
  target:
    context:
      v: medRq
    context type:
      v: variable
    element:
      v: insurance
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'https://example/Coverage/' + %coverage.id
  rule:
    name:
      v: act2
    source:
      context:
        v: entryrel2
      element:
        v: act
      variable:
        v: act2
    target:
      context:
        v: coverage
      context type:
        v: variable
      element:
        v: costToBeneficiary
      variable:
        v: cost
    rule:
      name:
        v: beneficmoney
    rule:
      name:
        v: exept

v: act2

v: cost

v: variable

v: value

v: val

v: create

value: string
  v: SimpleQuantity

v: bnm

context:
  v: act2

context:
  v: val
context type:
  v: variable
element:
  v: value
transform:
  v: copy
parameter:
  value: string
    v: 0

v: act2

v: cost

v: variable

v: exception

v: except

v: code

context:
  v: act2
element:
  v: code
variable:
  v: vvv

context:
  v: except
context type:
  v: variable
element:
  v: type
variable:
  v: vvv
transform:
  v: create

name:
  v: entry2
source:
  context:
    v: subAdm
  element:
    v: entryRelationship
  variable:
    v: entryrel3
  condition:
    v: (typeCode = 'RSON')
rule:
  name:
    v: obs3
  source:
    context:
      v: entryrel3
    element:
      v: observation
    variable:
      v: obs3
    condition:
      v: (classCode = 'OBS')
  rule:
    name:
      v: code
    source:
      context:
        v: obs3
      element:
        v: code
      variable:
        v: vvv
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: reasonCode
      variable:
        v: vvv
      transform:
        v: create
  rule:
    name:
      v: txt
    source:
      context:
        v: obs3
      element:
        v: text
      variable:
        v: text
    rule:
      name:
        v: originltext

v: text

v: medRq

v: variable

v: reasonCode

v: ce

v: tcf

context:
  v: text
element:
  v: reference
variable:
  v: reference

name:
  v: reference
source:
  context:
    v: reference
  element:
    v: value
  variable:
    v: l
target:
  context:
    v: ce
  context type:
    v: variable
  element:
    v: text
  transform:
    v: copy
  parameter:
    value: id
      v: l

v: text.reference as reference-> ce.text=reference;

name:
  v: code
source:
  context:
    v: subAdm
  element:
    v: entryRelationship
  variable:
    v: entryrel4
  condition:
    v: (typeCode = 'SUBJ')
rule:
  name:
    v: obs
  source:
    context:
      v: entryrel4
    element:
      v: observation
    variable:
      v: obs3
  target:
    context:
      v: medRq
    context type:
      v: variable
    element:
      v: substitution
    variable:
      v: sub
  rule:
    name:
      v: code
    source:
      context:
        v: obs3
      element:
        v: code
      variable:
        v: Code
    target:
      context:
        v: sub
      context type:
        v: variable
      element:
        v: allowed
      variable:
        v: allowed
      transform:
        v: create
      parameter:
        value: string
    dependent:
      name:
        v: CECodeableConcept
      variable:
        v: Code
      variable:
        v: allowed
  rule:
    name:
      v: entry
    source:
      context:
        v: obs3
      element:
        v: entryRelationship
      variable:
        v: entry
    rule:
      name:
        v: obs4

string
v: CodeableConcept

v: entry

v: observation

v: obs4

v: code

context:
  v: obs4
element:
  v: code
variable:
  v: vvv

context:
  v: sub
context type:
  v: variable
element:
  v: reason
variable:
  v: vvv
transform:
  v: create

name:
  v: entry2
source:
  context:
    v: subAdm
  element:
    v: entryRelationship
  variable:
    v: entryrel2
  condition:
    v: (typeCode = 'SUBJ')
rule:
  name:
    v: obs3
  source:
    context:
      v: entryrel2
    element:
      v: act
    variable:
      v: act2
    condition:
      v: (classCode = 'ACT')
  rule:
    name:
      v: reference
    source:
      context:
        v: act2
      element:
        v: text
      variable:
        v: text
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: note
      variable:
        v: note
    rule:
      name:
        v: tcx

v: text

v: reference

v: t

v: reference

context:
  v: t
element:
  v: value
variable:
  v: l

context:
  v: note
context type:
  v: variable
element:
  v: text
transform:
  v: copy
parameter:
  value: id
    v: l

name:
  v: ClinicalDocumentSectionAnnotazioni
type mode:
  v: none
documentation:
  v: ------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: medRq
  type:
    v: MedicationRequest
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: entry
  source:
    context:
      v: src
    element:
      v: text
    variable:
      v: cdaText
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'https://example/MedicationRequest/' + %medRq.id
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: text
    variable:
      v: fhirText
  rule:
    name:
      v: narrativeStatus
    source:
      context:
        v: cdaText
    target:
      context:
        v: fhirText
      context type:
        v: variable
      element:
        v: status
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: narrativeText
    source:
      context:
        v: cdaText
      variable:
        v: t
    target:
      context:
        v: fhirText
      context type:
        v: variable
      element:
        v: div
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: entry
    source:
      context:
        v: src
      element:
        v: entry
      variable:
        v: entry
    rule:
      name:
        v: act

string
v: generated

id
v: t

v: entry

v: act

v: act

v: reference

context:
  v: act
element:
  v: text
variable:
  v: text

context:
  v: medRq
context type:
  v: variable
element:
  v: note
variable:
  v: note

name:
  v: tcx
source:
  context:
    v: text
  element:
    v: reference
  variable:
    v: t
rule:
  name:
    v: reference
  source:
    context:
      v: t
    element:
      v: value
    variable:
      v: l
  target:
    context:
      v: note
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: id
        v: l

name:
  v: ClinicalDocumentSectionMessaggioRegionale
type mode:
  v: none
documentation:
  v: ------------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------------
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: medRq
  type:
    v: MedicationRequest
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: entry
  source:
    context:
      v: src
    element:
      v: text
    variable:
      v: cdaText
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'https://example/MedicationRequest/' + %medRq.id
  rule:
    name:
      v: nota
    source:
      context:
        v: cdaText
      variable:
        v: text
    target:
      context:
        v: medRq
      context type:
        v: variable
      element:
        v: note
      variable:
        v: note
    rule:
      name:
        v: reference

v: text

v: t

v: note

v: variable

v: text

v: copy

value: id
  v: t

name:
  v: ClinicalDocumentSectionParametriVitali
type mode:
  v: none
documentation:
  v: ------------Sezione Parametri Vitali-----------------------------------------------------------------------------------------------------------------------------------------
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: nota
  source:
    context:
      v: src
    element:
      v: text
    variable:
      v: cdaText
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e8
  target:
    context:
      v: e8
    context type:
      v: variable
    element:
      v: request
    variable:
      v: request
    transform:
      v: create
    parameter:
      value: string
        v: BackboneElement
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: string
        v: POST
  target:
    context:
      v: e8
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: Observation
    transform:
      v: create
    parameter:
      value: string
        v: Observation
  target:
    context:
      v: Observation
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid8
    transform:
      v: uuid
  target:
    context:
      v: e8
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: https://example/Observation/
    parameter:
      value: id
        v: uuid8
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: Observation
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference

v: variable

v: reference

v: evaluate

value: string
  v: 'https://example/Observation/' + %Observation.id

name:
  v: reference
source:
  context:
    v: src
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Patient/' + %patient.id

name:
  v: reference
source:
  context:
    v: src
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: encounter
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Encounter/' + %enc.id

name:
  v: code
source:
  context:
    v: src
  element:
    v: code
  variable:
    v: vvv
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: code
  variable:
    v: vvv
  transform:
    v: create

name:
  v: statuscode
source:
  context:
    v: src
  condition:
    v: Observation.statusCode.exists().not()
rule:
  name:
    v: status
  source:
    context:
      v: src
  target:
    context:
      v: Observation
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: final

name:
  v: reference
source:
  context:
    v: cdaText
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: note
  variable:
    v: note
rule:
  name:
    v: reference
  source:
    context:
      v: cdaText
    variable:
      v: t
  target:
    context:
      v: note
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: id
        v: t

name:
  v: ClinicalDocumentSectionAllergieaiFarmaci
type mode:
  v: none
documentation:
  v: ------------Sezione Allergie_Intolleranze-----------------------------------------------------------------------------------------------------------------------------------------
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: nota
  source:
    context:
      v: src
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e9
  target:
    context:
      v: e9
    context type:
      v: variable
    element:
      v: request
    variable:
      v: request
    transform:
      v: create
    parameter:
      value: string
        v: BackboneElement
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: string
        v: POST
  target:
    context:
      v: e9
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: allergyIntolerance
    transform:
      v: create
    parameter:
      value: string
        v: AllergyIntolerance
  target:
    context:
      v: allergyIntolerance
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid9
    transform:
      v: uuid
  target:
    context:
      v: e9
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: https://example/AllergyIntolerance/
    parameter:
      value: id
        v: uuid9
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: AllergyIntolerance
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference

v: evaluate

value: string
  v: 'https://example/AllergyIntolerance/' + %allergyIntolerance.id

name:
  v: reference
source:
  context:
    v: src
target:
  context:
    v: allergyIntolerance
  context type:
    v: variable
  element:
    v: patient
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Patient/' + %patient.id

name:
  v: allergy
source:
  context:
    v: src
target:
  context:
    v: allergyIntolerance
  context type:
    v: variable
  element:
    v: clinicalStatus
  variable:
    v: status
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
rule:
  name:
    v: text
  source:
    context:
      v: src
  target:
    context:
      v: status
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: string
        v: string
rule:
  name:
    v: coding
  source:
    context:
      v: src
  target:
    context:
      v: status
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: coding
    transform:
      v: create
    parameter:
      value: string
        v: Coding
  rule:
    name:
      v: active
    source:
      context:
        v: src
    target:
      context:
        v: coding
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: system
    source:
      context:
        v: src
    target:
      context:
        v: coding
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string

string
v: active

name:
  v: reference
source:
  context:
    v: src
  element:
    v: text
  variable:
    v: cdaText
target:
  context:
    v: allergyIntolerance
  context type:
    v: variable
  element:
    v: note
  variable:
    v: note
rule:
  name:
    v: reference
  source:
    context:
      v: cdaText
    variable:
      v: t
  target:
    context:
      v: note
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: id
        v: t

name:
  v: ClinicalDocumentSectionStatoClinicoPaziente
type mode:
  v: none
documentation:
  v: ------------Sezione Stato Clinico del Paziente----------------------------------------------------------------------------------------------------------------------------------------
input:
  name:
    v: cda
  type:
    v: ClinicalDocument
  mode:
    v: source
input:
  name:
    v: src
  type:
    v: Section
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: tgt
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: enc
  type:
    v: Encounter
  mode:
    v: target
rule:
  name:
    v: title
  source:
    context:
      v: src
    element:
      v: title
    variable:
      v: t
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: title
    transform:
      v: evaluate
    parameter:
      value: string
        v: t.dataString
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: vvv
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    variable:
      v: vvv
    transform:
      v: create
rule:
  name:
    v: nota
  source:
    context:
      v: src
    element:
      v: text
    variable:
      v: cdaText
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e7
  target:
    context:
      v: e7
    context type:
      v: variable
    element:
      v: request
    variable:
      v: request
    transform:
      v: create
    parameter:
      value: string
        v: BackboneElement
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: string
        v: POST
  target:
    context:
      v: e7
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: Observation
    transform:
      v: create
    parameter:
      value: string
        v: Observation
  target:
    context:
      v: Observation
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid7
    transform:
      v: uuid
  target:
    context:
      v: e7
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: https://example/Observation/
    parameter:
      value: id
        v: uuid7
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: Observation
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference

v: variable

v: reference

v: evaluate

value: string
  v: 'https://example/Observation/' + %Observation.id

name:
  v: reference
source:
  context:
    v: src
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Patient/' + %patient.id

name:
  v: reference
source:
  context:
    v: src
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: encounter
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'https://example/Encounter/' + %enc.id

name:
  v: code
source:
  context:
    v: src
  element:
    v: code
  variable:
    v: vvv
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: code
  variable:
    v: vvv
  transform:
    v: create

name:
  v: statuscode
source:
  context:
    v: src
  condition:
    v: Observation.statusCode.exists().not()
rule:
  name:
    v: status
  source:
    context:
      v: src
  target:
    context:
      v: Observation
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: final

name:
  v: reference
source:
  context:
    v: cdaText
target:
  context:
    v: Observation
  context type:
    v: variable
  element:
    v: note
  variable:
    v: note
rule:
  name:
    v: reference
  source:
    context:
      v: cdaText
    variable:
      v: t
  target:
    context:
      v: note
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: id
        v: t

name:
  v: periodTiming
type mode:
  v: none
input:
  name:
    v: effectiveTime
  type:
    v: PIVL_TS
  mode:
    v: source
input:
  name:
    v: timing
  type:
    v: Timing
  mode:
    v: target
rule:
  name:
    v: repeat
  source:
    context:
      v: effectiveTime
  target:
    context:
      v: timing
    context type:
      v: variable
    element:
      v: repeat
    variable:
      v: r
  rule:
    name:
      v: period
    source:
      context:
        v: effectiveTime
      element:
        v: period
      variable:
        v: p
    target:
      context:
        v: r
      context type:
        v: variable
      element:
        v: period
      transform:
        v: evaluate
      parameter:
        value: string
  rule:
    name:
      v: period
    source:
      context:
        v: effectiveTime
      element:
        v: period
      variable:
        v: p
    target:
      context:
        v: r
      context type:
        v: variable
      element:
        v: periodUnit
      transform:
        v: evaluate
      parameter:
        value: string

string
v: p.value

string
v: p.unit

name:
  v: EmedRTOPQPQRatio
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: RTO_PQ_PQ
  mode:
    v: source
input:
  name:
    v: tgt
  type:
    v: Ratio
  mode:
    v: target
rule:
  name:
    v: numerator
  source:
    context:
      v: src
    element:
      v: numerator
    variable:
      v: numerator
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: numerator
    variable:
      v: targetNumerator
  dependent:
    name:
      v: EmedPQQuantity
    variable:
      v: numerator
    variable:
      v: targetNumerator
rule:
  name:
    v: denominator
  source:
    context:
      v: src
    element:
      v: denominator
    variable:
      v: denominator
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: denominator
    variable:
      v: targetDenominator
  dependent:
    name:
      v: EmedPQQuantity
    variable:
      v: denominator
    variable:
      v: targetDenominator

name:
  v: EmedPQQuantity
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: PQ
  mode:
    v: source
input:
  name:
    v: tgt
  type:
    v: Quantity
  mode:
    v: target
rule:
  name:
    v: value
  source:
    context:
      v: src
    element:
      v: value
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: unit
  source:
    context:
      v: src
    element:
      v: unit
    variable:
      v: unit
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: id
        v: unit
rule:
  name:
    v: unit
  source:
    context:
      v: src
    element:
      v: unit
    variable:
      v: unit
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: system
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system
rule:
  name:
    v: unit
  source:
    context:
      v: src
    element:
      v: unit
    variable:
      v: unit
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: unit
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display