OrfQrToBundle
type: StructureMap
node role: treeRoot
id:
  v: OrfQrToBundle
text:
  status:
    v: generated
  div: Generated Narrative: StructureMap OrfQrToBundle map "http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle" = "OrfQrToBundle" // ORF QuestionnaireResponse to Bundle // 2021-01-11 Oliver Egger // QRF Questionnaire: http://fhir.ch/ig/ch-orf/Questionnaire-order-referral-form.html // QRF QuestionnaireResponse: http://fhir.ch/ig/ch-orf/QuestionnaireResponse-order-referral-form.xml.html // Bundle: http://fhir.ch/ig/ch-orf/StructureDefinition-ch-orf-document.html uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponseSource as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target uses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as target uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target uses "http://hl7.org/fhir/StructureDefinition/RelatedPerson" alias RelatedPerson as target uses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as target uses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as target uses "http://hl7.org/fhir/StructureDefinition/PractitionerRole" alias PractitionerRole as target uses "http://hl7.org/fhir/StructureDefinition/ServiceRequest" alias ServiceRequest as target uses "http://hl7.org/fhir/StructureDefinition/Extension" alias Extension as target uses "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" alias EpisodeOfCare as target uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as target group OrfQrToBundle(source qr : QuestionnaireResponseSource, target bundle : Bundle) { qr -> bundle.identifier as documentIdentifier, documentIdentifier.system = 'urn:ietf:rfc:3986', uuid() as uuidDoc, documentIdentifier.value = append('urn:uuid:', uuidDoc) "documentIdentifier"; qr -> bundle.entry as e, e.resource = create('Composition') as composition, composition.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), bundle.entry as e…
url:
  v: http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle
version:
  v: 3.0.1
name:
  v: OrfQrToBundle
status:
  v: draft
date:
  v: 2025-05-22T07:53:05+00:00
publisher:
  v: HL7 Switzerland
contact:
  name:
    v: HL7 Switzerland
  telecom:
    system:
      v: url
    value:
      v: https://www.hl7.ch/
description:
  v: ORF QuestionnaireResponse to Bundle 2021-01-11 Oliver Egger QRF Questionnaire: http://fhir.ch/ig/ch-orf/Questionnaire-order-referral-form.html QRF QuestionnaireResponse: http://fhir.ch/ig/ch-orf/QuestionnaireResponse-order-referral-form.xml.html Bundle: http://fhir.ch/ig/ch-orf/StructureDefinition-ch-orf-document.html
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
    code:
      v: CH
copyright:
  v: CC0-1.0
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
    link: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
  mode:
    v: source
  alias:
    v: QuestionnaireResponseSource
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: target
  alias:
    v: Composition
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    link: http://hl7.org/fhir/StructureDefinition/Patient
  mode:
    v: target
  alias:
    v: Patient
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
    link: http://hl7.org/fhir/StructureDefinition/RelatedPerson
  mode:
    v: target
  alias:
    v: RelatedPerson
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Organization
    link: http://hl7.org/fhir/StructureDefinition/Organization
  mode:
    v: target
  alias:
    v: Organization
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    link: http://hl7.org/fhir/StructureDefinition/Practitioner
  mode:
    v: target
  alias:
    v: Practitioner
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    link: http://hl7.org/fhir/StructureDefinition/PractitionerRole
  mode:
    v: target
  alias:
    v: PractitionerRole
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/ServiceRequest
    link: http://hl7.org/fhir/StructureDefinition/ServiceRequest
  mode:
    v: target
  alias:
    v: ServiceRequest
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    link: http://hl7.org/fhir/StructureDefinition/Extension
  mode:
    v: target
  alias:
    v: Extension
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare
    link: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare
  mode:
    v: target
  alias:
    v: EpisodeOfCare
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
    link: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
  mode:
    v: target
  alias:
    v: QuestionnaireResponse
group:
  name:
    v: OrfQrToBundle
  type mode:
    v: none
  input:
    name:
      v: qr
    type:
      v: QuestionnaireResponseSource
    mode:
      v: source
  input:
    name:
      v: bundle
    type:
      v: Bundle
    mode:
      v: target
  rule:
    name:
      v: documentIdentifier
    source:
      context:
        v: qr
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: identifier
      variable:
        v: documentIdentifier
    target:
      context:
        v: documentIdentifier
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context type:
        v: variable
      variable:
        v: uuidDoc
      transform:
        v: uuid
    target:
      context:
        v: documentIdentifier
      context type:
        v: variable
      element:
        v: value
      transform:
        v: append
      parameter:
        value: string
      parameter:
        value: id
  rule:
    name:
      v: OrfQrToBundle

string
v: urn:ietf:rfc:3986

string
v: urn:uuid:

id
v: uuidDoc

context:
  v: qr

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

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: composition
transform:
  v: create
parameter:
  value: string
    v: Composition

context:
  v: composition
context type:
  v: variable
element:
  v: id
variable:
  v: uuid
transform:
  v: uuid

context:
  v: e
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid

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

context:
  v: bundle
context type:
  v: variable
element:
  v: timestamp
variable:
  v: timestamp
transform:
  v: evaluate
parameter:
  value: string
    v: now()

context:
  v: bundle
context type:
  v: variable
element:
  v: type
transform:
  v: copy
parameter:
  value: string
    v: document

context:
  v: composition
context type:
  v: variable
element:
  v: date
transform:
  v: copy
parameter:
  value: id
    v: timestamp

context:
  v: composition
context type:
  v: variable
element:
  v: title
transform:
  v: copy
parameter:
  value: string
    v: Order and Referral by Form

context:
  v: composition
context type:
  v: variable
element:
  v: type
variable:
  v: type

context:
  v: type
context type:
  v: variable
element:
  v: coding
variable:
  v: coding

context:
  v: coding
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: string
    v: 419891008

context:
  v: coding
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: http://snomed.info/sct

context:
  v: composition
context type:
  v: variable
element:
  v: category
variable:
  v: category

context:
  v: category
context type:
  v: variable
element:
  v: coding
variable:
  v: coding

context:
  v: coding
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: string
    v: 721963009

context:
  v: coding
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: http://snomed.info/sct

context:
  v: e2
context type:
  v: variable
element:
  v: resource
variable:
  v: patient
transform:
  v: create
parameter:
  value: string
    v: Patient

context:
  v: patient
context type:
  v: variable
element:
  v: id
variable:
  v: uuid2
transform:
  v: uuid

context:
  v: e2
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid2

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

context:
  v: e4
context type:
  v: variable
element:
  v: resource
variable:
  v: questionnaireresp
transform:
  v: create
parameter:
  value: string
    v: QuestionnaireResponse

name:
  v: questionnaireresp
source:
  context:
    v: qr
dependent:
  name:
    v: QuestionnaireResponseMap
  variable:
    v: qr
  variable:
    v: questionnaireresp

name:
  v: orfbundle
source:
  context:
    v: qr
target:
  context:
    v: questionnaireresp
  context type:
    v: variable
  element:
    v: id
  variable:
    v: uuid4
  transform:
    v: uuid
target:
  context:
    v: e4
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: uuid4
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e5
target:
  context:
    v: e5
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: servicerequest
  transform:
    v: create
  parameter:
    value: string
      v: ServiceRequest
target:
  context:
    v: servicerequest
  context type:
    v: variable
  element:
    v: id
  variable:
    v: uuid5
  transform:
    v: uuid
target:
  context:
    v: e5
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: uuid5
dependent:
  name:
    v: QrToBundle
  variable:
    v: qr
  variable:
    v: patient
  variable:
    v: questionnaireresp
  variable:
    v: servicerequest
  variable:
    v: composition
  variable:
    v: bundle

name:
  v: QuestionnaireResponseMap
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: tgt
  type:
    v: QuestionnaireResponse
  mode:
    v: target
rule:
  name:
    v: identifier
  source:
    context:
      v: src
    element:
      v: identifier
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: identifier
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: basedOn
  source:
    context:
      v: src
    element:
      v: basedOn
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: basedOn
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: partOf
  source:
    context:
      v: src
    element:
      v: partOf
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: partOf
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: questionnaire
  source:
    context:
      v: src
    element:
      v: questionnaire
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: questionnaire
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: status
  source:
    context:
      v: src
    element:
      v: status
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: subject
  source:
    context:
      v: src
    element:
      v: subject
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: subject
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: encounter
  source:
    context:
      v: src
    element:
      v: encounter
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: encounter
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: authored
  source:
    context:
      v: src
    element:
      v: authored
    variable:
      v: value
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: authored
    transform:
      v: copy
    parameter:
      value: id
        v: value
rule:
  name:
    v: author
  source:
    context:
      v: src
    element:
      v: author
    variable:
      v: value

context:
  v: tgt
context type:
  v: variable
element:
  v: author
transform:
  v: copy
parameter:
  value: id
    v: value

name:
  v: source
source:
  context:
    v: src
  element:
    v: source
  variable:
    v: value
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: source
  transform:
    v: copy
  parameter:
    value: id
      v: value

name:
  v: item
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: value
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: item
  transform:
    v: copy
  parameter:
    value: id
      v: value

name:
  v: QrToGroups
type mode:
  v: none
input:
  name:
    v: qr
  type:
    v: QuestionnaireResponseSource
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: grporder
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'order'
  dependent:
    name:
      v: OrderItems
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: composition
    variable:
      v: serviceRequest
rule:
  name:
    v: receiver
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'receiver'
  dependent:
    name:
      v: ReceiverInit
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: composition
    variable:
      v: serviceRequest
rule:
  name:
    v: grpinitiator
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'initiator'
  dependent:
    name:
      v: InitiatorInit
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: patient
    variable:
      v: composition
    variable:
      v: serviceRequest
rule:
  name:
    v: grppatient
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'patient'
  dependent:
    name:
      v: PatientItems
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: patient
    variable:
      v: composition
    variable:
      v: serviceRequest
rule:
  name:
    v: grprequestedencounter
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'requestedEncounter'
  dependent:
    name:
      v: RequestedEncounterItems
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: patient
    variable:
      v: serviceRequest
rule:
  name:
    v: grprequestedencounter
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'coverage'
  dependent:
    name:
      v: Coverage
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: patient
    variable:
      v: serviceRequest
rule:
  name:
    v: grpsender
  source:
    context:
      v: qr
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'sender'
  dependent:
    name:
      v: SenderAuthorInit
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: composition

v: serviceRequest

name:
  v: receiverCopy
source:
  context:
    v: qr
  element:
    v: item
  variable:
    v: grp
  condition:
    v: linkId = 'receiverCopy'
dependent:
  name:
    v: ReceiverCopy
  variable:
    v: grp
  variable:
    v: bundle
  variable:
    v: patient
  variable:
    v: composition
  variable:
    v: serviceRequest

name:
  v: appointment
source:
  context:
    v: qr
  element:
    v: item
  variable:
    v: grp
  condition:
    v: linkId = 'appointment'
dependent:
  name:
    v: Appointment
  variable:
    v: grp
  variable:
    v: bundle
  variable:
    v: composition
  variable:
    v: serviceRequest

name:
  v: AntecedentEpisodeOfCareInit
source:
  context:
    v: qr
  element:
    v: item
  variable:
    v: grp
  condition:
    v: linkId = 'antecedentEpisodeOfCare'
dependent:
  name:
    v: AntecedentEpisodeOfCareInit
  variable:
    v: grp
  variable:
    v: bundle
  variable:
    v: patient
  variable:
    v: composition

name:
  v: consent
source:
  context:
    v: qr
  element:
    v: item
  variable:
    v: grp
  condition:
    v: linkId = 'consent'
dependent:
  name:
    v: Consent
  variable:
    v: grp
  variable:
    v: bundle
  variable:
    v: composition

name:
  v: note
source:
  context:
    v: qr
  element:
    v: item
  variable:
    v: grp
  condition:
    v: linkId = 'note'
dependent:
  name:
    v: Note
  variable:
    v: grp
  variable:
    v: serviceRequest

name:
  v: OrderItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: composition
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: orderPrecedentDocumentIdentifier
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.precedentDocumentIdentifier') and answer.exists())
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-precedentdocument
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: value
    transform:
      v: create
    parameter:
      value: string
        v: Identifier
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: urn:ietf:rfc:3986
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %item.answer.value
rule:
  name:
    v: orderPlacerOrderIdentifier
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.placerOrderIdentifier') and answer.exists())
  target:
    context:
      v: serviceRequest
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
    list mode:
      v: share
    list rule id:
      v: placer
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: type
    variable:
      v: type
  target:
    context:
      v: type
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: coding
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://terminology.hl7.org/CodeSystem/v2-0203
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: PLAC
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: orderPlacerOrderIdentifierDomain
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.placerOrderIdentifierDomain') and answer.exists())
  target:
    context:
      v: serviceRequest
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
    list mode:
      v: share
    list rule id:
      v: placer

context:
  v: value
context type:
  v: variable
element:
  v: system
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: orderFillerOrderIdentifier
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'order.fillerOrderIdentifier') and answer.exists())
target:
  context:
    v: serviceRequest
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
  list mode:
    v: share
  list rule id:
    v: filler
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: type
  variable:
    v: type
target:
  context:
    v: type
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
target:
  context:
    v: coding
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/v2-0203
target:
  context:
    v: coding
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: FILL
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: orderFillerOrderIdentifierDomain
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'order.fillerOrderIdentifierDomain') and answer.exists())
target:
  context:
    v: serviceRequest
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
  list mode:
    v: share
  list rule id:
    v: filler
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: item
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'order.authoredOn') and answer.exists())
target:
  context:
    v: serviceRequest
  context type:
    v: variable
  element:
    v: authoredOn
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: item
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'order.priority') and answer.exists())
target:
  context:
    v: serviceRequest
  context type:
    v: variable
  element:
    v: priority
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value.code

name:
  v: ordeNnotificationContactDocument
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: (linkId.value = 'order.notificationContactDocument')
rule:
  name:
    v: orderNotificationContactDocumentItems
  source:
    context:
      v: item
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerRoleDataEnterer
    transform:
      v: create
    parameter:
      value: string
        v: PractitionerRole
  target:
    context:
      v: practitionerRoleDataEnterer
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid4
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e5
  target:
    context:
      v: e5
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerDataEnterer
    transform:
      v: create
    parameter:
      value: string
        v: Practitioner
  target:
    context:
      v: practitionerDataEnterer
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid5
    transform:
      v: uuid
  target:
    context:
      v: e5
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid5
  target:
    context:
      v: practitionerRoleDataEnterer
    context type:
      v: variable
    element:
      v: practitioner
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid5
  rule:
    name:
      v: data
    source:
      context:
        v: item
    dependent:
      name:
        v: UrgentNotificationContactForRequestItems
      variable:
        v: item
      variable:
        v: practitionerRoleDataEnterer
      variable:
        v: practitionerDataEnterer
  rule:
    name:
      v: extension
    source:
      context:
        v: item
    dependent:
      name:
        v: ExtOrfUrgentNotificationContactForRequest
      variable:
        v: item
      variable:
        v: practitionerRoleDataEnterer
      variable:
        v: extension

name:
  v: orderNotificationContactDocumentResponse
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: (linkId.value = 'order.notificationContactDocumentResponse')
rule:
  name:
    v: orderNotificationContactDocumentResponseItems
  source:
    context:
      v: item
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerRoleDataEnterer
    transform:
      v: create
    parameter:
      value: string
        v: PractitionerRole
  target:
    context:
      v: practitionerRoleDataEnterer
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid4
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e5
  target:
    context:
      v: e5
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerDataEnterer
    transform:
      v: create
    parameter:
      value: string
        v: Practitioner
  target:
    context:
      v: practitionerDataEnterer
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid5
    transform:
      v: uuid
  target:
    context:
      v: e5
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid5
  target:
    context:
      v: practitionerRoleDataEnterer
    context type:
      v: variable
    element:
      v: practitioner
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid5
  rule:
    name:
      v: data
    source:
      context:
        v: item
    dependent:
      name:
        v: UrgentNotificationContactForResponseItems
      variable:
        v: item
      variable:
        v: practitionerRoleDataEnterer
      variable:
        v: practitionerDataEnterer
  rule:
    name:
      v: extension
    source:
      context:
        v: item
    dependent:
      name:
        v: ExtOrfUrgentNotificationContactForResponse
      variable:
        v: item
      variable:
        v: practitionerRoleDataEnterer
      variable:
        v: extension

name:
  v: UrgentNotificationContactForRequestPractitionerItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocument.practitioner.familyName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocument.practitioner.givenName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: senderAuthorPractitionerTitle
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocument.practitioner.title') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: prefix
    variable:
      v: prefix
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
  target:
    context:
      v: prefix
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: value
    transform:
      v: create
    parameter:
      value: string
        v: code
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: string
        v: AC
rule:
  name:
    v: senderAuthorPractitionerPhone
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocument.practitioner.phone') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: telecom
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable

v: system

v: copy

value: string
  v: phone

context:
  v: value
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: senderAuthorPractitionerEmail
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'order.notificationContactDocument.practitioner.email') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: email
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: UrgentNotificationContactForRequestItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitionerRole
  type:
    v: PractitionerRole
  mode:
    v: target
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'order.notificationContactDocument.practitioner')
  dependent:
    name:
      v: UrgentNotificationContactForRequestPractitionerItems
    variable:
      v: item
    variable:
      v: practitioner

name:
  v: ExtOrfUrgentNotificationContactForRequest
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitionerRole
  type:
    v: PractitionerRole
  mode:
    v: target
input:
  name:
    v: ext
  type:
    v: Extension
  mode:
    v: target
rule:
  name:
    v: url
  source:
    context:
      v: src
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-urgentnoficationcontactforthisdocument
rule:
  name:
    v: practitionerRole
  source:
    context:
      v: src
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    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: 'urn:uuid:' + %practitionerRole.id

name:
  v: UrgentNotificationContactForResponsePractitionerItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocumentResponse.practitioner.familyName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocumentResponse.practitioner.givenName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: senderAuthorPractitionerTitle
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocumentResponse.practitioner.title') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: prefix
    variable:
      v: prefix
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
  target:
    context:
      v: prefix
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: value
    transform:
      v: create
    parameter:
      value: string
        v: code
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: string
        v: AC
rule:
  name:
    v: senderAuthorPractitionerPhone
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'order.notificationContactDocumentResponse.practitioner.phone') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: telecom
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable

v: system

v: copy

value: string
  v: phone

context:
  v: value
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: senderAuthorPractitionerEmail
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'order.notificationContactDocumentResponse.practitioner.email') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: email
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: UrgentNotificationContactForResponseItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitionerRole
  type:
    v: PractitionerRole
  mode:
    v: target
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'order.notificationContactDocumentResponse.practitioner')
  dependent:
    name:
      v: UrgentNotificationContactForResponsePractitionerItems
    variable:
      v: item
    variable:
      v: practitioner

name:
  v: ExtOrfUrgentNotificationContactForResponse
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitionerRole
  type:
    v: PractitionerRole
  mode:
    v: target
input:
  name:
    v: ext
  type:
    v: Extension
  mode:
    v: target
rule:
  name:
    v: url
  source:
    context:
      v: src
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-urgentnoficationcontactfortheresponsetothisdocument
rule:
  name:
    v: practitionerRole
  source:
    context:
      v: src
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    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: 'urn:uuid:' + %practitionerRole.id

name:
  v: ReceiverPractitionerItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.practitioner.familyName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.practitioner.givenName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: receiverPractitionerTitle
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.practitioner.title') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: prefix
    variable:
      v: prefix
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
  target:
    context:
      v: prefix
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: value
    transform:
      v: create
    parameter:
      value: string
        v: code
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: string
        v: AC
rule:
  name:
    v: receiverPractitionerGln
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.practitioner.gln') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable

v: system

v: copy

value: string
  v: urn:oid:2.51.1.3

context:
  v: value
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: receiverPractitionerZsr
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'receiver.practitioner.zsr') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: urn:oid:2.16.756.5.30.1.123.100.2.1.1
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: receiverPractitionerPhone
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'receiver.practitioner.phone') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: phone
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: receiverPractitionerEmail
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'receiver.practitioner.email') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: email
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: ReceiverOrganizationItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: organization
  type:
    v: Organization
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.organization.name') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: name
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: receiverOrganizationGln
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.organization.gln') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: urn:oid:2.51.1.3
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: receiverOrganizationZsr
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.organization.zsr') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: urn:oid:2.16.756.5.30.1.123.100.2.1.1
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: itemAnswer
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.organization.streetAddressLine') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  rule:
    name:
      v: receiverOrganizationStreetAddressLine
    source:
      context:
        v: item
      element:
        v: answer
      variable:
        v: answer
    target:
      context:
        v: address
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: receiverOrganizationPostalCode
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'receiver.organization.postalCode') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress

string
v: %answer.value

context:
  v: address
context type:
  v: variable
element:
  v: postalCode
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: receiverOrganizationCity
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'receiver.organization.city') and answer.exists())
target:
  context:
    v: organization
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: city
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: receiverOrganizationCountry
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'receiver.organization.country') and answer.exists())
target:
  context:
    v: organization
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: country
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: ReceiverItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: practitionerRole
  type:
    v: PractitionerRole
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'receiver.practitioner')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e2
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitioner
    transform:
      v: create
    parameter:
      value: string
        v: Practitioner
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid2
    transform:
      v: uuid
  target:
    context:
      v: practitionerRole
    context type:
      v: variable
    element:
      v: practitioner
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid2
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid2
  dependent:
    name:
      v: ReceiverPractitionerItems
    variable:
      v: item
    variable:
      v: practitioner
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'receiver.organization')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e3
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: organization
    transform:
      v: create
    parameter:
      value: string
        v: Organization
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid3
    transform:
      v: uuid
  target:
    context:
      v: practitionerRole
    context type:
      v: variable
    element:
      v: organization
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid3
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: fullUrl

v: append

value: string
  v: urn:uuid:

value: id
  v: uuid3

name:
  v: ReceiverOrganizationItems
variable:
  v: item
variable:
  v: organization

name:
  v: Consent
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
rule:
  name:
    v: consentStatement
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'consent.statement') and answer.exists())
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: consent
    transform:
      v: create
    parameter:
      value: string
        v: Consent
  target:
    context:
      v: consent
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: active
  target:
    context:
      v: consent
    context type:
      v: variable
    element:
      v: scope
    variable:
      v: scope
  target:
    context:
      v: scope
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: coding
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: treatment
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://terminology.hl7.org/CodeSystem/consentscope
  target:
    context:
      v: consent
    context type:
      v: variable
    element:
      v: category
    variable:
      v: category
  target:
    context:
      v: category
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: coding
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: 59284-0
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://loinc.org
  target:
    context:
      v: consent
    context type:
      v: variable
    element:
      v: policyRule
    variable:
      v: policyRule
  target:
    context:
      v: policyRule
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: coding
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: 385432009
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://snomed.info/sct
  target:
    context:
      v: consent
    context type:
      v: variable
    element:
      v: id

v: uuid

v: uuid

context:
  v: e
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid

context:
  v: composition
context type:
  v: variable
element:
  v: extension
variable:
  v: ext

context:
  v: ext
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-patientconsent

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

context:
  v: consent
context type:
  v: variable
element:
  v: extension
variable:
  v: extcode

context:
  v: extcode
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-consentcode

context:
  v: extcode
context type:
  v: variable
element:
  v: value
variable:
  v: cc
transform:
  v: create
parameter:
  value: string
    v: CodeableConcept

context:
  v: cc
context type:
  v: variable
element:
  v: coding
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

context:
  v: reference
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid

name:
  v: itemAnswer
source:
  context:
    v: item
  element:
    v: answer
  variable:
    v: answer
rule:
  name:
    v: consentStatementNote
  source:
    context:
      v: answer
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'consent.statement.note') and answer.exists())
  target:
    context:
      v: consent
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extnote
  target:
    context:
      v: extnote
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-consentnote
  target:
    context:
      v: extnote
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value

name:
  v: ReceiverInit
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: receiver
  source:
    context:
      v: src
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerRole
    transform:
      v: create
    parameter:
      value: string
        v: PractitionerRole
  target:
    context:
      v: practitionerRole
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid
    transform:
      v: uuid
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-receiver
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid
  dependent:
    name:
      v: ReceiverItems
    variable:
      v: src
    variable:
      v: bundle
    variable:
      v: practitionerRole

name:
  v: InitiatorItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: ext
  type:
    v: Extension
  mode:
    v: target
rule:
  name:
    v: Initiatorpersonalrelation
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.personalrelation') and answer.exists())
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: ch-orf-personalrelation
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: Initiatorlegalrelation
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.legalrelation') and answer.exists())
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: ch-orf-legalrelation
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: InitiatorPractitionerRoleItems
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId = 'initiator.practitionerRole')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerrole
    transform:
      v: create
    parameter:
      value: string
        v: PractitionerRole
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  target:
    context:
      v: practitionerrole
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: ch-orf-personorganization
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: value
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference

context:
  v: reference
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid4

context:
  v: e4
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid4

name:
  v: data
source:
  context:
    v: item
dependent:
  name:
    v: InitiatorPractitionerRoleItems
  variable:
    v: item
  variable:
    v: bundle
  variable:
    v: practitionerrole

name:
  v: InitiatorelatedPerson
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: (linkId = 'initiator.relatedPerson')
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e4
target:
  context:
    v: e4
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: relatedPerson
  transform:
    v: create
  parameter:
    value: string
      v: RelatedPerson
target:
  context:
    v: ext
  context type:
    v: variable
  element:
    v: extension
  variable:
    v: extension
target:
  context:
    v: extension
  context type:
    v: variable
  element:
    v: url
  transform:
    v: copy
  parameter:
    value: string
      v: ch-orf-personorganization
target:
  context:
    v: extension
  context type:
    v: variable
  element:
    v: value
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: relatedPerson
  context type:
    v: variable
  element:
    v: id
  variable:
    v: uuid4
  transform:
    v: uuid
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: uuid4
target:
  context:
    v: relatedPerson
  context type:
    v: variable
  element:
    v: patient
  variable:
    v: reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: evaluate
  parameter:
    value: string
      v: 'urn:uuid:' + %patient.id
target:
  context:
    v: e4
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: uuid4
rule:
  name:
    v: data
  source:
    context:
      v: item
  dependent:
    name:
      v: InitiatorRelatedPersonItems
    variable:
      v: item
    variable:
      v: relatedPerson

name:
  v: InitiatorRelatedPersonItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: relatedPerson
  type:
    v: RelatedPerson
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.relatedPerson.familyName') and answer.exists())
  target:
    context:
      v: relatedPerson
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: name
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.relatedPerson.givenName') and answer.exists())
  target:
    context:
      v: relatedPerson
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: name
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: Phone
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.relatedPerson.phone') and answer.exists())
  rule:
    name:
      v: InitiatorelatedPersonPhone
    source:
      context:
        v: item
      element:
        v: answer
      variable:
        v: answer
    target:
      context:
        v: relatedPerson
      context type:
        v: variable
      element:
        v: telecom
      variable:
        v: value
    target:
      context:
        v: value
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: value
      context type:
        v: variable
      element:
        v: value
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: InitiatorelatedPersonEmail
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.relatedPerson.email') and answer.exists())
  target:
    context:
      v: relatedPerson
    context type:
      v: variable
    element:
      v: telecom
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: email
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: itemAnswer
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.relatedPerson.streetAddressLine') and answer.exists())
  target:
    context:
      v: relatedPerson

string
v: phone

string
v: %answer.value

v: variable

v: address

v: address

v: share

v: orgAddress

name:
  v: InitiatorelatedPersonStreetAddressLine
source:
  context:
    v: item
  element:
    v: answer
  variable:
    v: answer
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: line
  transform:
    v: evaluate
  parameter:
    value: string
      v: %answer.value

name:
  v: InitiatorelatedPersonPostalCode
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'initiator.relatedPerson.postalCode') and answer.exists())
target:
  context:
    v: relatedPerson
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: postalCode
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: InitiatorelatedPersonCity
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'initiator.relatedPerson.city') and answer.exists())
target:
  context:
    v: relatedPerson
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: city
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: InitiatorelatedPersonCountry
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'initiator.relatedPerson.country') and answer.exists())
target:
  context:
    v: relatedPerson
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: country
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: InitiatorPractitionerRoleItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: practitionerRole
  type:
    v: PractitionerRole
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'initiator.practitionerRole.practitioner')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e2
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitioner
    transform:
      v: create
    parameter:
      value: string
        v: Practitioner
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid2
    transform:
      v: uuid
  target:
    context:
      v: practitionerRole
    context type:
      v: variable
    element:
      v: practitioner
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid2
  target:
    context:
      v: e2
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid2
  dependent:
    name:
      v: InitiatorPractitionerItems
    variable:
      v: item
    variable:
      v: practitioner
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'initiator.practitionerRole.organization')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e3
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: organization
    transform:
      v: create
    parameter:
      value: string
        v: Organization
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid3
    transform:
      v: uuid
  target:
    context:
      v: practitionerRole
    context type:
      v: variable
    element:
      v: organization
    variable:
      v: reference
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: reference
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid3
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: fullUrl

v: append

value: string
  v: urn:uuid:

value: id
  v: uuid3

name:
  v: InitiatorOrganizationItems
variable:
  v: item
variable:
  v: organization

name:
  v: InitiatorPractitionerItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.practitioner.familyName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.practitioner.givenName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: InitiatorractitionerRolePractitionerTitle
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.practitioner.title') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: prefix
    variable:
      v: prefix
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
  target:
    context:
      v: prefix
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: value
    transform:
      v: create
    parameter:
      value: string
        v: code
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: string
        v: AC
rule:
  name:
    v: InitiatorractitionerRolePractitionerPhone
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.practitioner.phone') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: telecom
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable

v: system

v: copy

value: string
  v: phone

context:
  v: value
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: InitiatorractitionerRolePractitionerEmail
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'initiator.practitionerRole.practitioner.email') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: email
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: receiverPractitionerGln
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'initiator.practitionerRole.practitioner.gln') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: urn:oid:2.51.1.3
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: receiverPractitionerZsr
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'initiator.practitionerRole.practitioner.zsr') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: urn:oid:2.16.756.5.30.1.123.100.2.1.1
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: InitiatorOrganizationItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: organization
  type:
    v: Organization
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.organization.name') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: name
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: itemAnswer
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.organization.streetAddressLine') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  rule:
    name:
      v: InitiatorractitionerRoleOrganizationStreetAddressLine
    source:
      context:
        v: item
      element:
        v: answer
      variable:
        v: answer
    target:
      context:
        v: address
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: InitiatorractitionerRoleOrganizationPostalCode
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.organization.postalCode') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: postalCode
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: InitiatorractitionerRoleOrganizationCity
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.organization.city') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: city
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: InitiatorractitionerRoleOrganizationCountry
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'initiator.practitionerRole.organization.country') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: country
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value

string
v: %answer.value

name:
  v: FamilyDoctorInit
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: FamilyDoctorInit
  source:
    context:
      v: src
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: practitionerRole
    transform:
      v: create
    parameter:
      value: string
        v: PractitionerRole
  target:
    context:
      v: practitionerRole
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: patient
    context type:
      v: variable
    element:
      v: generalPractitioner
    variable:
      v: gp
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: gp
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid4
  rule:
    name:
      v: item
    source:
      context:
        v: src
      element:
        v: item
      variable:
        v: item
      condition:
        v: (linkId.value = 'familydoctor.practitioner')
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: e2
    target:
      context:
        v: e2
      context type:
        v: variable
      element:
        v: resource
      variable:
        v: practitioner
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: practitioner
      context type:
        v: variable
      element:
        v: id
      variable:
        v: uuid2
      transform:
        v: uuid
    target:
      context:
        v: practitionerRole
      context type:
        v: variable
      element:
        v: practitioner
      variable:
        v: reference
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: reference
      context type:
        v: variable
      element:
        v: reference
      transform:
        v: append
      parameter:
        value: string
      parameter:
        value: id
    target:
      context:
        v: e2
      context type:
        v: variable
      element:
        v: fullUrl
      transform:
        v: append
      parameter:
        value: string

string
v: Practitioner

string
v: Reference

string
v: urn:uuid:

id
v: uuid2

string
v: urn:uuid:

value: id
  v: uuid2

name:
  v: FamilyDoctorPractitionerItems
variable:
  v: item
variable:
  v: practitioner

name:
  v: item
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: (linkId.value = 'familydoctor.organization')
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e3
target:
  context:
    v: e3
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: organization
  transform:
    v: create
  parameter:
    value: string
      v: Organization
target:
  context:
    v: organization
  context type:
    v: variable
  element:
    v: id
  variable:
    v: uuid3
  transform:
    v: uuid
target:
  context:
    v: practitionerRole
  context type:
    v: variable
  element:
    v: organization
  variable:
    v: reference
  transform:
    v: create
  parameter:
    value: string
      v: Reference
target:
  context:
    v: reference
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: uuid3
target:
  context:
    v: e3
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: uuid3
dependent:
  name:
    v: FamilyDoctorOrganizationItems
  variable:
    v: item
  variable:
    v: organization

name:
  v: FamilyDoctorPractitionerItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: practitioner
  type:
    v: Practitioner
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.practitioner.familyName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.practitioner.givenName') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: practitionerName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: familydoctorPractitionerGln
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.practitioner.gln') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: urn:oid:2.51.1.3
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: familydoctorPractitionerZsr
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.practitioner.zsr') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: urn:oid:2.16.756.5.30.1.123.100.2.1.1
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: familydoctorPractitionerTitle
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.practitioner.title') and answer.exists())
  target:
    context:
      v: practitioner
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share

v: practitionerName

context:
  v: name
context type:
  v: variable
element:
  v: prefix
variable:
  v: prefix
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

context:
  v: prefix
context type:
  v: variable
element:
  v: extension
variable:
  v: ext

context:
  v: ext
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier

context:
  v: ext
context type:
  v: variable
element:
  v: value
variable:
  v: value
transform:
  v: create
parameter:
  value: string
    v: code

context:
  v: value
context type:
  v: variable
element:
  v: value
transform:
  v: copy
parameter:
  value: string
    v: AC

name:
  v: familydoctorPractitionerPhone
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'familydoctor.practitioner.phone') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: phone
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: familydoctorPractitionerEmail
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'familydoctor.practitioner.email') and answer.exists())
target:
  context:
    v: practitioner
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: email
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: FamilyDoctorOrganizationItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: organization
  type:
    v: Organization
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.organization.name') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: name
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: itemAnswer
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.organization.streetAddressLine') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  rule:
    name:
      v: familydoctorOrganizationStreetAddressLine
    source:
      context:
        v: item
      element:
        v: answer
      variable:
        v: answer
    target:
      context:
        v: address
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: familydoctorOrganizationPostalCode
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.organization.postalCode') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: postalCode
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: familydoctorOrganizationCity
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.organization.city') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: city
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: familydoctorOrganizationCountry
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'familydoctor.organization.country') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: country
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: familydoctorOrganizationGln
  source:
    context:
      v: src

string
v: %answer.value

v: item

v: item

v: ((linkId.value = 'familydoctor.organization.gln') and answer.exists())

context:
  v: organization
context type:
  v: variable
element:
  v: identifier
variable:
  v: value

context:
  v: value
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: urn:oid:2.51.1.3

context:
  v: value
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: familydoctorOrganizationZsr
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'familydoctor.organization.zsr') and answer.exists())
target:
  context:
    v: organization
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: urn:oid:2.16.756.5.30.1.123.100.2.1.1
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: AntecedentEpisodeOfCareInit
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
rule:
  name:
    v: AntecedentEpisodeOfCareItems
  source:
    context:
      v: src
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-antecedentepisodeofcare
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: episodeofcare
    transform:
      v: create
    parameter:
      value: string
        v: EpisodeOfCare
  target:
    context:
      v: episodeofcare
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %uuid4
  target:
    context:
      v: episodeofcare
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: finished
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: value
    variable:
      v: ref
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %episodeofcare.id
  dependent:
    name:
      v: AntecedentEpisodeOfCareItems
    variable:
      v: src
    variable:
      v: bundle
    variable:
      v: patient
    variable:
      v: episodeofcare

name:
  v: AntecedentEpisodeOfCareItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: tgt
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: episodeofcare
  type:
    v: EpisodeOfCare
  mode:
    v: target
rule:
  name:
    v: antecedentEpisodeOfCareRequestedPeriodStart
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'antecedentEpisodeOfCare.start') and answer.exists())
  target:
    context:
      v: episodeofcare
    context type:
      v: variable
    element:
      v: statusHistory
    variable:
      v: statusHistory
  target:
    context:
      v: statusHistory
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: finished
  target:
    context:
      v: statusHistory
    context type:
      v: variable
    element:
      v: period
    variable:
      v: period
  target:
    context:
      v: period
    context type:
      v: variable
    element:
      v: start
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
  target:
    context:
      v: period
    context type:
      v: variable
    element:
      v: end
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
  rule:
    name:
      v: antecedentEpisodeOfCareEndNotSameAsStart
    source:
      context:
        v: src
      element:
        v: item
      variable:
        v: iteme
      condition:
        v: ((linkId.value = 'antecedentEpisodeOfCare.end') and answer.exists())
    target:
      context:
        v: period
      context type:
        v: variable
      element:
        v: end
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: antecedentEpisodeOfCareManagingOrganization
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: (linkId.value = 'antecedentEpisodeOfCare.managingOrganization')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e3
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: organization
    transform:
      v: create
    parameter:
      value: string
        v: Organization
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid3
    transform:
      v: uuid
  target:
    context:
      v: e3
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid3
  target:
    context:
      v: episodeofcare
    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

string
v: %iteme.answer.value

value: string
  v: 'urn:uuid:' + %tgt.id

context:
  v: episodeofcare
context type:
  v: variable
element:
  v: managingOrganization
variable:
  v: reference
transform:
  v: create
parameter:
  value: string
    v: Reference

context:
  v: reference
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid3

name:
  v: AntecedentEpisodeOfCareOrganizationItems
variable:
  v: item
variable:
  v: organization

name:
  v: AntecedentEpisodeOfCareOrganizationItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: organization
  type:
    v: Organization
  mode:
    v: target
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.name') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: name
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: itemAnswer
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.streetAddressLine') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  rule:
    name:
      v: antecedentEpisodeOfCareorganizationStreetAddressLine
    source:
      context:
        v: item
      element:
        v: answer
      variable:
        v: answer
    target:
      context:
        v: address
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: senderAuthorOrganizationPostalCode
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.postalCode') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: postalCode
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: senderAuthorOrganizationCity
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.city') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: city
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: senderAuthorOrganizationCountry
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.country') and answer.exists())
  target:
    context:
      v: organization
    context type:
      v: variable
    element:
      v: address
    variable:
      v: address
    list mode:
      v: share
    list rule id:
      v: orgAddress
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: country
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value

string
v: %answer.value

name:
  v: InitiatorInit
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: receiver
  source:
    context:
      v: src
  target:
    context:
      v: composition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-initiator
  dependent:
    name:
      v: InitiatorItems
    variable:
      v: src
    variable:
      v: bundle
    variable:
      v: patient
    variable:
      v: ext

name:
  v: PatientItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: tgt
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: composition
  type:
    v: Composition
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: grpfamily
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: grp
    condition:
      v: linkId = 'familydoctor'
  dependent:
    name:
      v: FamilyDoctorInit
    variable:
      v: grp
    variable:
      v: bundle
    variable:
      v: tgt
    variable:
      v: composition
    variable:
      v: serviceRequest
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
  dependent:
    name:
      v: PatientItems
    variable:
      v: item
    variable:
      v: bundle
    variable:
      v: tgt
    variable:
      v: composition
    variable:
      v: serviceRequest
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.familyName') and answer.exists())
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: patientName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.maidenName') and answer.exists())
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: use
    transform:
      v: copy
    parameter:
      value: string
        v: maiden
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.givenName') and answer.exists())
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: patientName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value

name:
  v: PatientLocalPid
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.localPid') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
  list mode:
    v: share
  list rule id:
    v: localpid
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: type
  variable:
    v: type
target:
  context:
    v: type
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
target:
  context:
    v: coding
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/v2-0203
target:
  context:
    v: coding
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: MR
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: PatientLocalPidDomain
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.localPidDomain') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: identifier
  variable:
    v: value
  list mode:
    v: share
  list rule id:
    v: localpid
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: item
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.birthDate') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: birthDate
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: item
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.gender') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: gender
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value.code

name:
  v: patientMaritalStatus
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.maritalStatus') and answer.exists())
rule:
  name:
    v: answer
  source:
    context:
      v: item
    element:
      v: answer
    variable:
      v: answer
  rule:
    name:
      v: maritalStatus
    source:
      context:
        v: answer
      type:
        v: Coding
      element:
        v: value
      variable:
        v: coding
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: maritalStatus
      variable:
        v: maritalStatus
    target:
      context:
        v: maritalStatus
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: copy
      parameter:
        value: id

id
v: coding

name:
  v: PatientPhone
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.phone') and answer.exists())
rule:
  name:
    v: PatientPhone
  source:
    context:
      v: item
    element:
      v: answer
    variable:
      v: answer
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: telecom
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: phone
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %answer.value

name:
  v: PatientEmail
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.email') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: value
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: email
target:
  context:
    v: value
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: itemAnswer
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.streetAddressLine') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
rule:
  name:
    v: PatientStreetAddressLine
  source:
    context:
      v: item
    element:
      v: answer
    variable:
      v: answer
  target:
    context:
      v: address
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: string
        v: %answer.value

name:
  v: PatientPostalCode
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.postalCode') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: postalCode
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: PatientCity
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.city') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: city
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: PatientCountry
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.country') and answer.exists())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: address
  variable:
    v: address
  list mode:
    v: share
  list rule id:
    v: orgAddress
target:
  context:
    v: address
  context type:
    v: variable
  element:
    v: country
  transform:
    v: evaluate
  parameter:
    value: string
      v: %item.answer.value

name:
  v: PatientLanguageOfCorrespondence
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'patient.languageOfCorrespondence') and answer.exists())
rule:
  name:
    v: answer
  source:
    context:
      v: item
    element:
      v: answer
    variable:
      v: answer
  rule:
    name:
      v: languageOfCorrespondence
    source:
      context:
        v: answer
      type:
        v: Coding
      element:
        v: value
      variable:
        v: coding
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: communication
      variable:
        v: communication
    target:
      context:
        v: communication
      context type:
        v: variable
      element:
        v: preferred
      transform:
        v: copy
      parameter:
        value: boolean
    target:
      context:
        v: communication
      context type:
        v: variable
      element:
        v: language
      variable:
        v: language
    target:
      context:
        v: language
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: copy
      parameter:
        value: id

boolean
v: true

id
v: coding

name:
  v: contact
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: item
  condition:
    v: (linkId.value = 'patient.contactperson')
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: contact
  variable:
    v: contact
rule:
  name:
    v: item
  source:
    context:
      v: item
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.contactperson.familyName') and answer.exists())
  target:
    context:
      v: contact
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: contactName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: family
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: item
  source:
    context:
      v: item
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.contactperson.givenName') and answer.exists())
  target:
    context:
      v: contact
    context type:
      v: variable
    element:
      v: name
    variable:
      v: name
    list mode:
      v: share
    list rule id:
      v: contactName
  target:
    context:
      v: name
    context type:
      v: variable
    element:
      v: given
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: PatientContactpersonPhone
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.contactperson.phone') and answer.exists())
  rule:
    name:
      v: PatientPhone
    source:
      context:
        v: item
      element:
        v: answer
      variable:
        v: answer
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: telecom
      variable:
        v: value
    target:
      context:
        v: value
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: value
      context type:
        v: variable
      element:
        v: value
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: PatientEmail
  source:
    context:
      v: item
    element:
      v: item
    variable:
      v: item
    condition:
      v: ((linkId.value = 'patient.contactperson.email') and answer.exists())
  target:
    context:
      v: contact
    context type:
      v: variable
    element:
      v: telecom
    variable:
      v: value
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: email
  target:
    context:
      v: value
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: string
        v: %item.answer.value
rule:
  name:
    v: PatientContactpersonRelationship
  source:
    context:
      v: item
    element:
      v: item
    variable:
      v: item

string
v: phone

string
v: %answer.value

v: ((linkId.value = 'patient.contactperson.relationship') and answer.exists())

context:
  v: contact
context type:
  v: variable
element:
  v: relationship
variable:
  v: relationship

context:
  v: relationship
context type:
  v: variable
element:
  v: text
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: RequestedEncounterItems
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: RequestedEncounterItems
  source:
    context:
      v: src
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: encounter
    transform:
      v: create
    parameter:
      value: string
        v: Encounter
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %uuid4
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: planned
  target:
    context:
      v: serviceRequest
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: subject
    variable:
      v: subject
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: subject
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %patient.id
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-requestedencounterdetails
  target:
    context:
      v: extension
    context type:
      v: variable
    element:
      v: value
    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: 'urn:uuid:' + %uuid4
  rule:
    name:
      v: requestedEncounterClass
    source:
      context:
        v: src
      element:
        v: item
      variable:
        v: item
      condition:
        v: ((linkId.value = 'requestedEncounter.class') and answer.exists())
    target:
      context:
        v: encounter
      context type:
        v: variable
      element:
        v: class
      transform:
        v: evaluate
      parameter:
        value: string
  rule:
    name:
      v: requestedEncounterDesiredAccommodation
    source:
      context:
        v: src
      element:
        v: item
      variable:
        v: item
      condition:
        v: ((linkId.value = 'requestedEncounter.desiredAccommodation') and answer.exists())

string
v: %item.answer.value

context:
  v: encounter
context type:
  v: variable
element:
  v: extension
variable:
  v: extension

context:
  v: extension
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: string
    v: http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-desiredaccommodation

context:
  v: extension
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: %item.answer.value

name:
  v: Coverage
type mode:
  v: none
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: serviceRequest
  type:
    v: ServiceRequest
  mode:
    v: target
rule:
  name:
    v: coverageBeneficiary
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: where(linkId.value = 'coverage.beneficiary')
  rule:
    name:
      v: coverageBeneficiaryAhvn13
    source:
      context:
        v: item
      element:
        v: item
      variable:
        v: item
      condition:
        v: ((linkId.value = 'coverage.beneficiary.ahvn13') and answer.exists())
    target:
      context:
        v: patient
      context type:
        v: variable
      element:
        v: identifier
      variable:
        v: identifier
    target:
      context:
        v: identifier
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: identifier
      context type:
        v: variable
      element:
        v: value
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: coveragekvg
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: item
    condition:
      v: where(linkId.value = 'coverage.kvg')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e4
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: coverage
    transform:
      v: create
    parameter:
      value: string
        v: Coverage
  target:
    context:
      v: coverage
    context type:
      v: variable
    element:
      v: id
    variable:
      v: uuid4
    transform:
      v: uuid
  target:
    context:
      v: e4
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %uuid4
  target:
    context:
      v: serviceRequest
    context type:
      v: variable
    element:
      v: insurance
    variable:
      v: insurance
  target:
    context:
      v: insurance
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %uuid4
  target:
    context:
      v: coverage
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: active
  target:
    context:
      v: coverage
    context type:
      v: variable
    element:
      v: beneficiary
    variable:
      v: subject
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: subject
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: string
        v: 'urn:uuid:' + %patient.id

string
v: urn:oid:2.16.756.5.32

string
v: %item.answer.value

context:
  v: coverage
context type:
  v: variable
element:
  v: type
variable:
  v: type

context:
  v: type
context type:
  v: variable
element:
  v: coding
variable:
  v: coding

context:
  v: coding
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: http://fhir.ch/ig/ch-core/CodeSystem/bfs-medstats-25-mainguarantor

context:
  v: coding
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: string
    v: 1

name:
  v: coverageKvgName
source:
  context:
    v: item
  element:
    v: item
  variable:
    v: item
  condition:
    v: ((linkId.value = 'coverage.kvg.name') and answer.exists())
target:
  context:
    v: coverage
  context type:
    v: variable
  element:
    v: payor
  variable:
    v: payor
target:
  context:
    v: payor
  context type:
    v: variable