This page is part of the CH ORF (R4) (v2.0.0-ballot: STU 2 Ballot 1) based on FHIR R4. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions
Draft as of 2023-06-29 |
{
"resourceType" : "StructureMap",
"id" : "OrfQrToBundle",
"text" : {
"status" : "additional",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle" = "OrfQrToBundle"\n\n//\n// ORF QuestionnaireResponse to Bundle\n// 2021-01-11 Oliver Egger, copyright ahdis ag, Apache License \n// QRF Questionnaire: http://fhir.ch/ig/ch-orf/Questionnaire-order-referral-form.html\n// QRF QuestionnaireResponse: http://fhir.ch/ig/ch-orf/QuestionnaireResponse-order-referral-form.xml.html\n// Bundle: http://fhir.ch/ig/ch-orf/StructureDefinition-ch-orf-document.html\n\nuses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source\nuses "http://hl7.org/fhir/StructureDefinition/BackboneElement" alias BackboneElement as source\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target\nuses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as target\nuses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target\nuses "http://hl7.org/fhir/StructureDefinition/RelatedPerson" alias RelatedPerson as target\nuses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as target\nuses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as target\nuses "http://hl7.org/fhir/StructureDefinition/PractitionerRole" alias PractitionerRole as target\nuses "http://hl7.org/fhir/StructureDefinition/ServiceRequest" alias ServiceRequest as target\nuses "http://hl7.org/fhir/StructureDefinition/Extension" alias Extension as target\nuses "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" alias EpisodeOfCare as target\nuses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponseTarget as target\n\ngroup OrfQrToBundle(source qr : QuestionnaireResponse, target bundle : Bundle ) {\n qr -> bundle.identifier as documentIdentifier, documentIdentifier.system = 'urn:ietf:rfc:3986', uuid() as uuidDoc, documentIdentifier.value = append('urn:uuid:', uuidDoc) "documentIdentifier";\n qr as qrcp -> bundle.entry as e, \n e.resource = create('Composition') as composition, \n composition.id = uuid() as uuid,\n e.fullUrl = append('urn:uuid:',uuid),\n bundle.entry as e2, \n bundle.timestamp = (now()) as timestamp,\n composition.date = timestamp,\n composition.title = 'Order and Referral by Form',\n composition.type as type, type.coding as coding, coding.code = '419891008', coding.system = 'http://snomed.info/sct',\n composition.category as category, category.coding as coding, coding.code = '721963009', coding.system = 'http://snomed.info/sct',\n e2.resource = create('Patient') as patient,\n patient.id = uuid() as uuid2,\n e2.fullUrl = append('urn:uuid:',uuid2),\n bundle.entry as e4, \n e4.resource = qrcp as questionnaireresp,\n questionnaireresp.id = uuid() as uuid4,\n e4.fullUrl = append('urn:uuid:',uuid4),\n bundle.entry as e5, \n e5.resource = create('ServiceRequest') as servicerequest, \n servicerequest.id = uuid() as uuid5,\n e5.fullUrl = append('urn:uuid:',uuid5) then {\n qr.questionnaire as can -> bundle.entry as e6, e6.resource = (can.resolve()) as q, q.id = uuid() as uuid6, e6.fullUrl = append('urn:uuid:',uuid6) then QrToBundle(qr, q, patient, questionnaireresp, servicerequest, composition, bundle) "orfbundle";\n } "orfbundle";\n}\n\ngroup QrToGroups(source qr : QuestionnaireResponse, target patient : Patient, target bundle: Bundle, target composition : Composition, target serviceRequest: ServiceRequest) {\n qr.item as grp where linkId='order' then OrderItems(grp, bundle, composition, serviceRequest) "grporder";\n qr.item as grp where linkId='receiver' then ReceiverInit(grp, bundle, composition, serviceRequest) "receiver";\n qr.item as grp where linkId='initiator' then InitiatorInit(grp, bundle, patient, composition, serviceRequest) "grpinitiator";\n qr.item as grp where linkId='patient' then PatientItems(grp, bundle, patient, composition, serviceRequest) "grppatient";\n qr.item as grp where linkId='requestedEncounter' then RequestedEncounterItems(grp, bundle, patient, serviceRequest) "grprequestedencounter";\n qr.item as grp where linkId='coverage' then Coverage(grp, bundle, patient, serviceRequest) "grprequestedencounter";\n qr.item as grp where linkId='sender' then SenderAuthorInit(grp, bundle, composition, serviceRequest) "grpsender";\n qr.item as grp where linkId='receiverCopy' then ReceiverCopy(grp, bundle, patient, composition, serviceRequest) "receiverCopy";\n qr.item as grp where linkId='appointment' then Appointment(grp, bundle, composition, serviceRequest) "appointment";\n qr.item as grp where linkId='previousResults' then PreviousResults(grp, bundle, serviceRequest) "previousResults";\n qr.item as grp where linkId='antecedentEpisodeOfCare' then AntecedentEpisodeOfCareInit(grp, bundle, patient, composition) "AntecedentEpisodeOfCareInit";\n qr.item as grp where linkId='consent' then Consent(grp, bundle, composition) "consent";\n qr.item as grp where linkId='note' then Note(grp, serviceRequest) "note";\n}\n\ngroup OrderItems(source src : BackboneElement, target bundle: Bundle, target composition, target serviceRequest : ServiceRequest) {\n\n src.item as item where (linkId.value = 'order.precedentDocumentIdentifier' and answer.exists()) -> composition.extension as ext, ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-precedentdocument',\n ext.value = create('Identifier') as value, value.system='urn:ietf:rfc:3986', value.value=('urn:uuid:'+item.answer.valueString) "order.precedentDocumentIdentifier"; \n\n src.item as item where (linkId.value = 'order.placerOrderIdentifier' and answer.exists()) -> serviceRequest.identifier as value share placer, \n value.type as type, type.coding as coding,\n coding.system = 'http://terminology.hl7.org/CodeSystem/v2-0203',\n coding.code = 'PLAC',\n value.value=(item.answer.valueString) "order.placerOrderIdentifier"; \n src.item as item where (linkId.value = 'order.placerOrderIdentifierDomain' and answer.exists()) -> serviceRequest.identifier as value share placer, \n value.system=(item.answer.valueString) "order.placerOrderIdentifierDomain"; \n src.item as item where (linkId.value = 'order.fillerOrderIdentifier' and answer.exists()) -> serviceRequest.identifier as value share filler, \n value.type as type, type.coding as coding,\n coding.system = 'http://terminology.hl7.org/CodeSystem/v2-0203',\n coding.code = 'FILL',\n value.value=(item.answer.valueString) "order.fillerOrderIdentifier"; \n src.item as item where (linkId.value = 'order.fillerOrderIdentifierDomain' and answer.exists()) -> serviceRequest.identifier as value share filler, \n value.system=(item.answer.valueString) "order.fillerOrderIdentifierDomain"; \n\n src.item as item where (linkId.value = 'order.dateTime' and answer.exists()) -> serviceRequest.authoredOn = (item.answer.value);\n\n src.item as item where (linkId.value = 'order.priority' and answer.exists()) -> serviceRequest.priority = (item.answer.value.code);\n\n src.item as item where (linkId.value = 'order.notificationContactDocument') then {\n item -> bundle.entry as e4, \n e4.resource = create('PractitionerRole') as practitionerRoleDataEnterer, \n practitionerRoleDataEnterer.id = uuid() as uuid4,\n e4.fullUrl = append('urn:uuid:',uuid4),\n composition.extension as extension,\n bundle.entry as e5, \n e5.resource = create('Practitioner') as practitionerDataEnterer, \n practitionerDataEnterer.id = uuid() as uuid5,\n e5.fullUrl = append('urn:uuid:',uuid5),\n practitionerRoleDataEnterer.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid5)\n// ,\n// FIXME not known here practitionerRoleDataEnterer.organization = create('Reference') as reference, reference.type='Organization', reference.reference = append('urn:uuid:',uuid3) \n then {\n item then UrgentNotificationContactForRequestItems(item, practitionerRoleDataEnterer, practitionerDataEnterer) "data";\n item then ExtOrfUrgentNotificationContactForRequest(item, practitionerRoleDataEnterer, extension) "extension";\n } "order.notificationContactDocument.items";\n } "order.notificationContactDocument";\n \n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse') then {\n item -> bundle.entry as e4, \n e4.resource = create('PractitionerRole') as practitionerRoleDataEnterer, \n practitionerRoleDataEnterer.id = uuid() as uuid4,\n e4.fullUrl = append('urn:uuid:',uuid4),\n composition.extension as extension,\n bundle.entry as e5, \n e5.resource = create('Practitioner') as practitionerDataEnterer, \n practitionerDataEnterer.id = uuid() as uuid5,\n e5.fullUrl = append('urn:uuid:',uuid5),\n practitionerRoleDataEnterer.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid5)\n// ,\n// FIXME not known here practitionerRoleDataEnterer.organization = create('Reference') as reference, reference.type='Organization', reference.reference = append('urn:uuid:',uuid3) \n then {\n item then UrgentNotificationContactForResponseItems(item, practitionerRoleDataEnterer, practitionerDataEnterer) "data";\n item then ExtOrfUrgentNotificationContactForResponse(item, practitionerRoleDataEnterer, extension) "extension";\n } "order.notificationContactDocumentResponse.items";\n } "order.notificationContactDocumentResponse";\n}\n\ngroup UrgentNotificationContactForRequestPractitionerItems(source src : BackboneElement, target practitioner: Practitioner) {\n src.item as item where (linkId.value = 'order.notificationContactDocument.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'order.notificationContactDocument.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'order.notificationContactDocument.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "sender.author.practitioner.title"; \n src.item as item where (linkId.value = 'order.notificationContactDocument.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "sender.author.practitioner.phone"; \n src.item as item where (linkId.value = 'order.notificationContactDocument.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "sender.author.practitioner.email"; \n}\n\ngroup UrgentNotificationContactForRequestItems(source src : BackboneElement, target practitionerRole: practitionerRole, target practitioner : Practitioner) {\n src.item as item where (linkId.value = 'order.notificationContactDocument.practitioner') then UrgentNotificationContactForRequestPractitionerItems(item, practitioner);\n}\n\ngroup ExtOrfUrgentNotificationContactForRequest(source src: BackboneElement, target practitionerRole: PractitionerRole, target ext: Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-urgentnoficationcontactforthisdocument' "url";\n src -> ext.value = create('Reference') as reference, \n reference.reference = ('urn:uuid:'+%practitionerRole.id) "practitionerRole";\n}\n\ngroup UrgentNotificationContactForResponsePractitionerItems(source src : BackboneElement, target practitioner: Practitioner) {\n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "sender.author.practitioner.title"; \n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "sender.author.practitioner.phone"; \n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "sender.author.practitioner.email"; \n}\n\ngroup UrgentNotificationContactForResponseItems(source src : BackboneElement, target practitionerRole: practitionerRole, target practitioner : Practitioner) {\n src.item as item where (linkId.value = 'order.notificationContactDocumentResponse.practitioner') then UrgentNotificationContactForResponsePractitionerItems(item, practitioner);\n}\n\ngroup ExtOrfUrgentNotificationContactForResponse(source src: BackboneElement, target practitionerRole: PractitionerRole, target ext: Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-urgentnoficationcontactfortheresponsetothisdocument' "url";\n src -> ext.value = create('Reference') as reference, \n reference.reference = ('urn:uuid:'+%practitionerRole.id) "practitionerRole";\n}\n\n\ngroup ReceiverPractitionerItems(source src : BackboneElement, target practitioner : Practitioner) {\n src.item as item where (linkId.value = 'receiver.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'receiver.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'receiver.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "receiver.practitioner.title"; \n src.item as item where (linkId.value = 'receiver.practitioner.gln' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "receiver.practitioner.gln"; \n src.item as item where (linkId.value = 'receiver.practitioner.zsr' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "receiver.practitioner.zsr"; \n src.item as item where (linkId.value = 'receiver.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "receiver.practitioner.phone"; \n src.item as item where (linkId.value = 'receiver.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "receiver.practitioner.email"; \n}\n\ngroup ReceiverOrganizationItems(source src : BackboneElement, target organization : Organization) {\n src.item as item where (linkId.value = 'receiver.organization.name' and answer.exists()) -> organization.name = (item.answer.value);\n src.item as item where (linkId.value = 'receiver.organization.gln' and answer.exists()) -> organization.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "receiver.organization.gln";\n src.item as item where (linkId.value = 'receiver.organization.zsr' and answer.exists()) -> organization.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "receiver.organization.zsr"; \n src.item as item where (linkId.value = 'receiver.organization.streetAddressLine' and answer.exists()) -> organization.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "receiver.organization.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'receiver.organization.postalCode' and answer.exists()) -> organization.address as address share orgAddress, address.postalCode = (item.answer.value) "receiver.organization.postalCode";\n src.item as item where (linkId.value = 'receiver.organization.city' and answer.exists()) -> organization.address as address share orgAddress, address.city = (item.answer.value) "receiver.organization.city";\n src.item as item where (linkId.value = 'receiver.organization.country' and answer.exists()) -> organization.address as address share orgAddress, address.country = (item.answer.value) "receiver.organization.country";\n}\n\ngroup ReceiverItems(source src : BackboneElement, target bundle: Bundle, target practitionerRole: practitionerRole) {\n src.item as item where (linkId.value = 'receiver.practitioner') -> \n bundle.entry as e2, \n e2.resource = create('Practitioner') as practitioner, \n practitioner.id = uuid() as uuid2,\n practitionerRole.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid2),\n e2.fullUrl = append('urn:uuid:',uuid2) then ReceiverPractitionerItems(item, practitioner);\n src.item as item where (linkId.value = 'receiver.organization') ->\n bundle.entry as e3, \n e3.resource = create('Organization') as organization, \n organization.id = uuid() as uuid3,\n practitionerRole.organization = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid3), \n e3.fullUrl = append('urn:uuid:',uuid3) then ReceiverOrganizationItems(item, organization);\n}\n\ngroup Consent(source src : BackboneElement, target bundle: Bundle, target composition : Composition) {\n src.item as item where (linkId.value = 'consent.statement' and answer.exists()) -> bundle.entry as e, \n e.resource = create('Consent') as consent,\n consent.status = 'active', \n consent.scope as scope, scope.coding as coding, coding.code = 'treatment', coding.system= 'http://terminology.hl7.org/CodeSystem/consentscope',\n consent.category as category, category.coding as coding, coding.code = '59284-0', coding.system= 'http://loinc.org',\n consent.policyRule as policyRule, policyRule.coding as coding, coding.code = '385432009', coding.system= 'http://snomed.info/sct',\n consent.id = uuid() as uuid,\n e.fullUrl = append('urn:uuid:',uuid),\n composition.extension as ext, \n ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-patientconsent',\n ext.value = create('Reference') as reference, \n consent.extension as extcode,\n extcode.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-consentcode',\n extcode.value = create('CodeableConcept') as cc, cc.coding = (item.answer.value),\n reference.reference = append('urn:uuid:',uuid) then {\n item.answer as answer then {\n answer.item as item where (linkId.value = 'consent.statement.note' and answer.exists())\n -> consent.extension as extnote,\n extnote.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-consentnote',\n extnote.value = (item.answer.value) "consent.statement.note";\n } "item.answer";\n } "consent.statement";\n}\n\ngroup ReceiverInit(source src : BackboneElement, target bundle: Bundle, target composition : Composition, target serviceRequest: ServiceRequest) {\n src -> bundle.entry as e, \n e.resource = create('PractitionerRole') as practitionerRole, \n practitionerRole.id = uuid() as uuid,\n e.fullUrl = append('urn:uuid:',uuid),\n composition.extension as ext, \n ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-receiver',\n ext.value = create('Reference') as reference, \n reference.reference = append('urn:uuid:',uuid) then\n ReceiverItems(src, bundle, practitionerRole) "receiver";\n}\n\ngroup InitiatorItems(source src : BackboneElement, target bundle: Bundle, target patient: Patient, target ext: Extension) {\n src.item as item where (linkId.value = 'initiator.personalrelation' and answer.exists()) -> \n ext.extension as extension, \n extension.url = 'ch-orf-personalrelation', \n extension.value = (item.answer.value) "initiator.personalrelation";\n src.item as item where (linkId.value = 'initiator.legalrelation' and answer.exists()) -> \n ext.extension as extension, \n extension.url = 'ch-orf-legalrelation', \n extension.value = (item.answer.value) "initiator.legalrelation";\n src.item as item where (linkId='initiator.practitionerRole') -> bundle.entry as e4, \n e4.resource = create('PractitionerRole') as practitionerrole, \n ext.extension as extension,\n practitionerrole.id = uuid() as uuid4,\n extension.url = 'ch-orf-personorganization',\n extension.value = create('Reference') as reference, \n reference.reference = append('urn:uuid:',uuid4),\n e4.fullUrl = append('urn:uuid:',uuid4) then {\n item then InitiatorPractitionerRoleItems(item, bundle, practitionerrole) "data";\n } "InitiatorPractitionerRoleItems";\n src.item as item where (linkId='initiator.relatedPerson') -> bundle.entry as e4, \n e4.resource = create('RelatedPerson') as relatedPerson,\n ext.extension as extension, \n extension.url = 'ch-orf-personorganization',\n extension.value = create('Reference') as reference, \n relatedPerson.id = uuid() as uuid4,\n reference.reference = append('urn:uuid:',uuid4),\n relatedPerson.patient as reference,\n reference.reference = ('urn:uuid:'+%patient.id),\n e4.fullUrl = append('urn:uuid:',uuid4) then {\n item then InitiatorRelatedPersonItems(item, relatedPerson) "data";\n } "initiator.relatedPerson";\n}\n\ngroup InitiatorRelatedPersonItems(source src : BackboneElement, target relatedPerson: RelatedPerson) {\n src.item as item where (linkId.value = 'initiator.relatedPerson.familyName' and answer.exists()) -> relatedPerson.name as name share name, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'initiator.relatedPerson.givenName' and answer.exists()) -> relatedPerson.name as name share name, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'initiator.relatedPerson.phone' and answer.exists()) then {\n item.answer as answer -> relatedPerson.telecom as value, value.system = 'phone',\n value.value= (answer.value) "initiator.relatedPerson.phone"; \n } "phone";\n src.item as item where (linkId.value = 'initiator.relatedPerson.email' and answer.exists()) -> relatedPerson.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "initiator.relatedPerson.email"; \n src.item as item where (linkId.value = 'initiator.relatedPerson.streetAddressLine' and answer.exists()) -> relatedPerson.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "initiator.relatedPerson.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'initiator.relatedPerson.postalCode' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.postalCode = (item.answer.value) "initiator.relatedPerson.postalCode";\n src.item as item where (linkId.value = 'initiator.relatedPerson.city' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.city = (item.answer.value) "initiator.relatedPerson.city";\n src.item as item where (linkId.value = 'initiator.relatedPerson.country' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.country = (item.answer.value) "initiator.relatedPerson.country";\n}\n\n\ngroup InitiatorPractitionerRoleItems(source src : BackboneElement, target bundle: Bundle, target practitionerRole: practitionerRole) {\n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner') -> \n bundle.entry as e2, \n e2.resource = create('Practitioner') as practitioner, \n practitioner.id = uuid() as uuid2,\n practitionerRole.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid2),\n e2.fullUrl = append('urn:uuid:',uuid2) then InitiatorPractitionerItems(item, practitioner);\n src.item as item where (linkId.value = 'initiator.practitionerRole.organization') ->\n bundle.entry as e3, \n e3.resource = create('Organization') as organization, \n organization.id = uuid() as uuid3,\n practitionerRole.organization = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid3), \n e3.fullUrl = append('urn:uuid:',uuid3) then InitiatorOrganizationItems(item, organization);\n}\n\ngroup InitiatorPractitionerItems(source src : BackboneElement, target practitioner : Practitioner) {\n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "initiator.practitionerRole.practitioner.title"; \n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "initiator.practitionerRole.practitioner.phone"; \n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "initiator.practitionerRole.practitioner.email"; \n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.gln' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "receiver.practitioner.gln"; \n src.item as item where (linkId.value = 'initiator.practitionerRole.practitioner.zsr' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "receiver.practitioner.zsr"; \n}\n\ngroup InitiatorOrganizationItems(source src : BackboneElement, target organization : Organization) {\n src.item as item where (linkId.value = 'initiator.practitionerRole.organization.name' and answer.exists()) -> organization.name = (item.answer.value);\n src.item as item where (linkId.value = 'initiator.practitionerRole.organization.streetAddressLine' and answer.exists()) -> organization.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "initiator.practitionerRole.organization.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'initiator.practitionerRole.organization.postalCode' and answer.exists()) -> organization.address as address share orgAddress, address.postalCode = (item.answer.value) "initiator.practitionerRole.organization.postalCode";\n src.item as item where (linkId.value = 'initiator.practitionerRole.organization.city' and answer.exists()) -> organization.address as address share orgAddress, address.city = (item.answer.value) "initiator.practitionerRole.organization.city";\n src.item as item where (linkId.value = 'initiator.practitionerRole.organization.country' and answer.exists()) -> organization.address as address share orgAddress, address.country = (item.answer.value) "initiator.practitionerRole.organization.country";\n}\n\ngroup FamilyDoctorInit(source src : BackboneElement, target bundle: Bundle, target patient: Patient, target composition : Composition, target serviceRequest: ServiceRequest) {\n src -> bundle.entry as e4, \n e4.resource = create('PractitionerRole') as practitionerRole,\n practitionerRole.id = uuid() as uuid4,\n patient.generalPractitioner = create('Reference') as gp, \n gp.reference = append('urn:uuid:',uuid4),\n e4.fullUrl = append('urn:uuid:',uuid4) then {\n src.item as item where (linkId.value = 'familydoctor.practitioner') -> \n bundle.entry as e2, \n e2.resource = create('Practitioner') as practitioner, \n practitioner.id = uuid() as uuid2,\n practitionerRole.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid2),\n e2.fullUrl = append('urn:uuid:',uuid2) then FamilyDoctorPractitionerItems(item, practitioner);\n\n src.item as item where (linkId.value = 'familydoctor.organization') ->\n bundle.entry as e3, \n e3.resource = create('Organization') as organization, \n organization.id = uuid() as uuid3,\n practitionerRole.organization = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid3), \n e3.fullUrl = append('urn:uuid:',uuid3) then FamilyDoctorOrganizationItems(item, organization);\n } "FamilyDoctorInit";\n}\n\ngroup FamilyDoctorPractitionerItems(source src : BackboneElement, target practitioner : Practitioner) {\n src.item as item where (linkId.value = 'familydoctor.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'familydoctor.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'familydoctor.practitioner.gln' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "familydoctor.practitioner.gln"; \n src.item as item where (linkId.value = 'familydoctor.practitioner.zsr' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "familydoctor.practitioner.zsr"; \n src.item as item where (linkId.value = 'familydoctor.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "familydoctor.practitioner.title"; \n src.item as item where (linkId.value = 'familydoctor.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "familydoctor.practitioner.phone"; \n src.item as item where (linkId.value = 'familydoctor.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "familydoctor.practitioner.email"; \n}\n\ngroup FamilyDoctorOrganizationItems(source src : BackboneElement, target organization : Organization) {\n src.item as item where (linkId.value = 'familydoctor.organization.name' and answer.exists()) -> organization.name = (item.answer.value);\n src.item as item where (linkId.value = 'familydoctor.organization.streetAddressLine' and answer.exists()) -> organization.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "familydoctor.organization.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'familydoctor.organization.postalCode' and answer.exists()) -> organization.address as address share orgAddress, address.postalCode = (item.answer.value) "familydoctor.organization.postalCode";\n src.item as item where (linkId.value = 'familydoctor.organization.city' and answer.exists()) -> organization.address as address share orgAddress, address.city = (item.answer.value) "familydoctor.organization.city";\n src.item as item where (linkId.value = 'familydoctor.organization.country' and answer.exists()) -> organization.address as address share orgAddress, address.country = (item.answer.value) "familydoctor.organization.country";\n src.item as item where (linkId.value = 'familydoctor.organization.gln' and answer.exists()) -> organization.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "familydoctor.organization.gln";\n src.item as item where (linkId.value = 'familydoctor.organization.zsr' and answer.exists()) -> organization.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "familydoctorr.organization.zsr"; \n}\n\ngroup AntecedentEpisodeOfCareInit(source src : BackboneElement, target bundle: Bundle, target patient: Patient, target composition : Composition) {\n src -> composition.extension as ext, \n ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-antecedentepisodeofcare',\n bundle.entry as e4, \n e4.resource = create('EpisodeOfCare') as episodeofcare, \n episodeofcare.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n episodeofcare.status = 'finished',\n ext.value = create('Reference') as ref, ref.reference = ('urn:uuid:'+%episodeofcare.id)\n then AntecedentEpisodeOfCareItems(src, bundle, patient, episodeofcare) "AntecedentEpisodeOfCareItems";\n}\n\ngroup AntecedentEpisodeOfCareItems(source src : BackboneElement, target bundle: Bundle, target tgt: Patient, target episodeofcare : EpisodeOfCare) {\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.start' and answer.exists()) -> episodeofcare.statusHistory as statusHistory, statusHistory.status='finished', statusHistory.period as period, period.start = (item.answer.value), period.end = (item.answer.value) then {\n src.item as iteme where (linkId.value = 'antecedentEpisodeOfCare.end' and answer.exists()) -> period.end = (iteme.answer.value) "antecedentEpisodeOfCareEndNotSameAsStart";\n } "antecedentEpisodeOfCare.requestedPeriod.start";\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.managingOrganization') -> \n bundle.entry as e3, \n e3.resource = create('Organization') as organization, \n organization.id = uuid() as uuid3,\n e3.fullUrl = append('urn:uuid:',uuid3),\n episodeofcare.patient = create('Reference') as reference, reference.reference = ('urn:uuid:'+%tgt.id),\n episodeofcare.managingOrganization = create('Reference') as reference, \n reference.reference = append('urn:uuid:',uuid3) then AntecedentEpisodeOfCareOrganizationItems(item, organization) "antecedentEpisodeOfCare.managingOrganization";\n}\n\ngroup AntecedentEpisodeOfCareOrganizationItems(source src : BackboneElement, target organization : Organization) {\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.managingOrganization.name' and answer.exists()) -> organization.name = (item.answer.value);\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.managingOrganization.streetAddressLine' and answer.exists()) -> organization.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "antecedentEpisodeOfCareorganization.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.managingOrganization.postalCode' and answer.exists()) -> organization.address as address share orgAddress, address.postalCode = (item.answer.value) "sender.author.organization.postalCode";\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.managingOrganization.city' and answer.exists()) -> organization.address as address share orgAddress, address.city = (item.answer.value) "sender.author.organization.city";\n src.item as item where (linkId.value = 'antecedentEpisodeOfCare.managingOrganization.country' and answer.exists()) -> organization.address as address share orgAddress, address.country = (item.answer.value) "sender.author.organization.country";\n}\n\ngroup InitiatorInit(source src : BackboneElement, target bundle: Bundle, target patient: Patient, target composition : Composition, target serviceRequest: ServiceRequest) {\n src -> composition.extension as ext, \n ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-initiator'\n then InitiatorItems(src, bundle, patient, ext) "receiver";\n}\n\ngroup PatientItems(source src : BackboneElement, target bundle: Bundle, target tgt: Patient, target composition : Composition, target serviceRequest: ServiceRequest) {\n src.item as grp where linkId='familydoctor' then FamilyDoctorInit(grp, bundle, tgt, composition, serviceRequest) "grpfamily";\n\n src.item as item then PatientItems(item, bundle, tgt, composition, serviceRequest);\n src.item as item where (linkId.value = 'patient.familyName' and answer.exists()) -> tgt.name as name share patientName,name.family = (item.answer.value);\n src.item as item where (linkId.value = 'patient.maidenName' and answer.exists()) -> tgt.name as name, name.use = 'maiden', name.family = (item.answer.value);\n src.item as item where (linkId.value = 'patient.givenName' and answer.exists()) -> tgt.name as name share patientName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'patient.localPid' and answer.exists()) -> tgt.identifier as value share localpid, \n value.type as type, type.coding as coding,\n coding.system = 'http://terminology.hl7.org/CodeSystem/v2-0203',\n coding.code = 'MR',\n value.value=(item.answer.valueString) "patient.localPid";\n src.item as item where (linkId.value = 'patient.localPidDomain' and answer.exists()) -> tgt.identifier as value share localpid, \n value.system=(item.answer.valueString) "patient.localPidDomain"; \n src.item as item where (linkId.value = 'patient.birthDate' and answer.exists()) -> tgt.birthDate = (item.answer.value);\n src.item as item where (linkId.value = 'patient.gender' and answer.exists()) -> tgt.gender = (item.answer.value.code);\n src.item as item where (linkId.value = 'patient.maritalStatus' and answer.exists()) then {\n item.answer as answer then {\n answer.value: Coding as coding -> tgt.maritalStatus as maritalStatus, maritalStatus.coding = coding "maritalStatus"; \n } "answer";\n } "patient.maritalStatus"; \n src.item as item where (linkId.value = 'patient.phone' and answer.exists()) then {\n item.answer as answer -> tgt.telecom as value, value.system = 'phone', value.value=(answer.value) "patient.phone"; \n } "patient.phone";\n src.item as item where (linkId.value = 'patient.email' and answer.exists()) -> tgt.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "patient.email"; \n src.item as item where (linkId.value = 'patient.streetAddressLine' and answer.exists()) -> tgt.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "patient.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'patient.postalCode' and answer.exists()) -> tgt.address as address share orgAddress, address.postalCode = (item.answer.value) "patient.postalCode";\n src.item as item where (linkId.value = 'patient.city' and answer.exists()) -> tgt.address as address share orgAddress, address.city = (item.answer.value) "patient.city";\n src.item as item where (linkId.value = 'patient.country' and answer.exists()) -> tgt.address as address share orgAddress, address.country = (item.answer.value) "patient.country";\n\n src.item as item where (linkId.value = 'patient.languageOfCorrespondence' and answer.exists()) then {\n item.answer as answer then {\n answer.value: Coding as coding -> tgt.communication as communication, communication.preferred = true, communication.language as language, language.coding = coding "languageOfCorrespondence"; \n } "answer";\n } "patient.languageOfCorrespondence"; \n\n src.item as item where (linkId.value = 'patient.contactperson') -> tgt.contact as contact then {\n item.item as item where (linkId.value = 'patient.contactperson.familyName' and answer.exists()) -> contact.name as name share contactName,name.family = (item.answer.value);\n item.item as item where (linkId.value = 'patient.contactperson.givenName' and answer.exists()) -> contact.name as name share contactName, name.given = (item.answer.value);\n\n src.item as item where (linkId.value = 'patient.contactperson.phone' and answer.exists()) then {\n item.answer as answer -> tgt.telecom as value, value.system = 'phone', value.value=(answer.value) "patient.phone"; \n } "patient.contactperson.phone";\n \n item.item as item where (linkId.value = 'patient.contactperson.email' and answer.exists()) -> contact.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "patient.email"; \n item.item as item where (linkId.value = 'patient.contactperson.relationship' and answer.exists()) -> contact.relationship as relationship, \n relationship.text=(item.answer.value) "patient.contactperson.relationship"; \n } "contact";\n}\n\ngroup RequestedEncounterItems(source src : BackboneElement, target bundle: Bundle, target patient: Patient, target serviceRequest : ServiceRequest) {\n src -> bundle.entry as e4, \n e4.resource = create('Encounter') as encounter, \n encounter.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n encounter.status = 'planned',\n serviceRequest.extension as extension,\n encounter.subject = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n extension.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-requestedencounterdetails',\n extension.value = create('Reference') as reference, reference.reference = ('urn:uuid:'+%uuid4) \n then {\n src.item as item where (linkId.value = 'requestedEncounter.class' and answer.exists()) -> \n encounter.class = (item.answer.value) "requestedEncounter.class";\n src.item as item where (linkId.value = 'requestedEncounter.desiredAccommodation' and answer.exists()) -> \n encounter.extension as extension,\n extension.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-desiredaccommodation', \n extension.value = (item.answer.value) "requestedEncounter.desiredAccommodation";\n } "RequestedEncounterItems";\n }\n\n group Coverage(source src : BackboneElement, target bundle: Bundle, target patient: Patient, target serviceRequest : ServiceRequest) {\n// coverage.beneficiary\n// coverage.beneficiary.ahvn13\n src.item as item where where (linkId.value = 'coverage.beneficiary') then {\n item.item as item where (linkId.value = 'coverage.beneficiary.ahvn13' and answer.exists()) -> \n patient.identifier as identifier, identifier.system = 'urn:oid:2.16.756.5.32', identifier.value = (item.answer.value) "coverage.beneficiary.ahvn13";\n } "coverage.beneficiary";\n\n// coverage.kvg\t\n// coverage.kvg.name\t \n// coverage.kvg.insuranceCardNumber\t\n src.item as item where where (linkId.value = 'coverage.kvg') -> bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'KVG' then {\n item.item as item where (linkId.value = 'coverage.kvg.name' and answer.exists()) ->\n coverage.payor as payor, payor.reference as refcontained, refcontained.value = '#org', \n coverage.contained = create('Organization') as organization, organization.id = 'org', organization.name = (item.answer.value) "coverage.kvg.name";\n item.item as item where (linkId.value = 'coverage.kvg.insuranceCardNumber' and answer.exists()) ->\n coverage.identifier as identifier, identifier.type as typeid, typeid.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype', coding.code = 'VeKa', \n identifier.value = (item.answer.value) "coverage.kvg.insuranceCardNumber";\n } "coveragekvg";\n// coverage.uvg\tUnfallversicherung (nach UVG)\t0..1\tgroup\t\tDefinition: Coverage.type\n// coverage.uvg.name\tName der Versicherung\t0..1\tstring\t\tDefinition: Coverage.payor\n// coverage.uvg.claimNumber\tSchadennummer\t0..1\tstring\t\tDefinition: Coverage.identifier\n src.item as item where where (linkId.value = 'coverage.uvg') -> bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'UVG' then {\n item.item as item where (linkId.value = 'coverage.uvg.name' and answer.exists()) ->\n coverage.payor as payor, payor.reference as refcontained, refcontained.value = '#org', \n coverage.contained = create('Organization') as organization, organization.id = 'org', organization.name = (item.answer.value) "coverage.uvg.name";\n item.item as item where (linkId.value = 'coverage.uvg.claimNumber' and answer.exists()) ->\n coverage.identifier as identifier, identifier.type as typeid, typeid.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype', coding.code = 'Claim', \n identifier.value = (item.answer.value) "coverage.uvg.claimNumber";\n } "coverageuvg";\n// coverage.vvg\tZusatzversicherung (nach VVG)\t0..1\tgroup\t\tDefinition: Coverage.type\n// coverage.vvg.name\tName der Versicherung\t0..1\tstring\t\tDefinition: Coverage.payor\n// coverage.vvg.insuranceCardNumber\tKennnummer der Versichertenkarte\t0..1\tstring\t\tDefinition: Coverage.identifier\n src.item as item where where (linkId.value = 'coverage.vvg') -> bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'VVG' then {\n item.item as item where (linkId.value = 'coverage.vvg.name' and answer.exists()) ->\n coverage.payor as payor, payor.reference as refcontained, refcontained.value = '#org', \n coverage.contained = create('Organization') as organization, organization.id = 'org', organization.name = (item.answer.value) "coverage.vvg.name";\n item.item as item where (linkId.value = 'coverage.vvg.insuranceCardNumber' and answer.exists()) ->\n coverage.identifier as identifier, identifier.type as typeid, typeid.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype', coding.code = 'VeKa', \n identifier.value = (item.answer.value) "coverage.vvg.insuranceCardNumber";\n } "coveragevvg";\n\n// coverage.iv\tInvalidenversicherung (IV)\t0..1\tgroup\t\tDefinition: Coverage.type\n// coverage.iv.verfuegungsnummer\nsrc.item as item where where (linkId.value = 'coverage.iv') -> bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'IVG' then {\n item.item as item where (linkId.value = 'coverage.iv.verfuegungsnummer' and answer.exists()) ->\n coverage.identifier as identifier, identifier.type as typeid, typeid.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype', coding.code = 'IV', \n identifier.value = (item.answer.value),\n coverage.payor as payor, payor.reference as refcontained, refcontained.value = '#org', \n coverage.contained = create('Organization') as organization, organization.id = 'org', organization.name = 'IV' "coverage.iv.verfuegungsnummer";\n } "coverageiv";\n\n // coverage.mv\tMilitärversicherung (MV)\t0..1\tgroup\t\tDefinition: Coverage.type\n// coverage.mv.versichertennummer\nsrc.item as item where where (linkId.value = 'coverage.mv') -> bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'MVG' then {\n item.item as item where (linkId.value = 'coverage.mv.versichertennummer' and answer.exists()) ->\n coverage.identifier as identifier, identifier.type as typeid, typeid.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype', coding.code = 'MV', \n identifier.value = (item.answer.value),\n coverage.payor as payor, payor.reference as refcontained, refcontained.value = '#org', \n coverage.contained = create('Organization') as organization, organization.id = 'org', organization.name = 'MV' "coverage.mv.versichertennummer";\n } "coveragemv";\n \n // coverage.self\tSelbstzahler\t0..1\tgroup\t\tDefinition: Coverage.type\n // coverage.self.familyName\tName\t0..1\tstring\t\tDefinition: Coverage.payor\n // coverage.self.givenName\tVorname\t0..1\tstring\t\tDefinition: Coverage.payor\n src.item as item where where (linkId.value = 'coverage.self') then {\n \n item.item as item where (linkId.value = 'coverage.self.patient' and answer.exists() and answer.value) ->\n bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'Self',\n coverage.payor as subject, subject.reference = ('urn:uuid:'+%patient.id) "payor";\n\n item.item as item2 where (linkId.value = 'coverage.self.patientRelatedPerson' and answer.exists() and answer.value) then { \n item.item as item where (linkId.value = 'coverage.self.relatedPerson') ->\n bundle.entry as e5, \n e5.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e5.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'Self',\n bundle.entry as e6, \n e6.resource = create('RelatedPerson') as relatedPerson, \n relatedPerson.id = uuid() as uuid6,\n e6.fullUrl = append('urn:uuid:',uuid6),\n coverage.payor as subject, subject.reference = ('urn:uuid:'+%relatedPerson.id),\n relatedPerson.patient as reference, reference.reference = ('urn:uuid:'+%patient.id)\n then \n CoverageRelatedPersonItems(item,relatedPerson) "coverage.self.relatedPerson";\n } "coverage.self.patientrelated.";\n } "self";\n \n// coverage.other\tAnderer Kostenträger\t0..1\tgroup\t\tDefinition: Coverage.type\n// coverage.other.name\tName des Kostenträgers\t0..1\tstring\t\tDefinition: Coverage.payor\n// coverage.other.id\tBeliebige ID\t0..1\tstring\t\tDefinition: Coverage.identifier\n// coverage.other.id.note TODO\n src.item as item where where (linkId.value = 'coverage.other') -> bundle.entry as e4, \n e4.resource = create('Coverage') as coverage, \n coverage.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.insurance as insurance, insurance.reference = ('urn:uuid:'+%uuid4),\n coverage.status = 'active',\n coverage.beneficiary = create('Reference') as subject, subject.reference = ('urn:uuid:'+%patient.id),\n coverage.type as type, type.coding as coding, coding.system = 'http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype', coding.code = 'Other' then {\n item.item as item where (linkId.value = 'coverage.other.name' and answer.exists()) ->\n coverage.payor as payor, payor.reference as refcontained, refcontained.value = '#org', \n coverage.contained = create('Organization') as organization, organization.id = 'org', organization.name = (item.answer.value) "coverage.other.name";\n item.item as item where (linkId.value = 'coverage.other.id' and answer.exists()) ->\n coverage.identifier as identifier, identifier.value = (item.answer.value) "coverage.other.id";\n } "coveragevvg";\n}\n\ngroup CoverageRelatedPersonItems(source src : BackboneElement, target relatedPerson: RelatedPerson) {\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.familyName' and answer.exists()) -> relatedPerson.name as name share name, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.givenName' and answer.exists()) -> relatedPerson.name as name share name, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.phone' and answer.exists()) then {\n item.answer as answer -> relatedPerson.telecom as value, value.system = 'phone',\n value.value= (answer.value) "coverage.self.relatedPerson.phone"; \n } "phone";\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.email' and answer.exists()) -> relatedPerson.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "coverage.self.relatedPerson.email"; \n src.item as item where (linkId.value = 'coverage.self.relatedPerson.streetAddressLine' and answer.exists()) -> relatedPerson.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "coverage.self.relatedPerson.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.postalCode' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.postalCode = (item.answer.value) "coverage.self.relatedPerson.postalCode";\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.city' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.city = (item.answer.value) "coverage.self.relatedPerson.city";\n src.item as item where (linkId.value = 'coverage.self.relatedPerson.country' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.country = (item.answer.value) "coverage.self.relatedPerson.country";\n}\n\n\ngroup SenderAuthorPractitionerItems(source src : BackboneElement, target practitioner: Practitioner) {\n src.item as item where (linkId.value = 'sender.author.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'sender.author.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'sender.author.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "sender.author.practitioner.title"; \n src.item as item where (linkId.value = 'sender.author.practitioner.gln' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "sender.author.practitioner.gln"; \n src.item as item where (linkId.value = 'sender.author.practitioner.zsr' and answer.exists()) -> practitioner.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "recsender.author.practitioner.zsr"; \n src.item as item where (linkId.value = 'sender.author.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "sender.author.practitioner.phone"; \n src.item as item where (linkId.value = 'sender.author.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "sender.author.practitioner.email"; \n}\n\ngroup SenderAuthorOrganizationItems(source src : BackboneElement, target organization: Organization) {\n src.item as item where (linkId.value = 'sender.author.organization.name' and answer.exists()) -> organization.name = (item.answer.value);\n src.item as item where (linkId.value = 'sender.author.organization.gln' and answer.exists()) -> organization.identifier as value, \n value.system = 'urn:oid:2.51.1.3',\n value.value=(item.answer.value) "sender.author.organization.gln";\n src.item as item where (linkId.value = 'sender.author.organization.zsr' and answer.exists()) -> organization.identifier as value, \n value.system = 'urn:oid:2.16.756.5.30.1.123.100.2.1.1',\n value.value=(item.answer.value) "sender.author.organization.zsr"; \n src.item as item where (linkId.value = 'sender.author.organization.streetAddressLine' and answer.exists()) -> organization.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "sender.author.organization.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'sender.author.organization.postalCode' and answer.exists()) -> organization.address as address share orgAddress, address.postalCode = (item.answer.value) "sender.author.organization.postalCode";\n src.item as item where (linkId.value = 'sender.author.organization.city' and answer.exists()) -> organization.address as address share orgAddress, address.city = (item.answer.value) "sender.author.organization.city";\n src.item as item where (linkId.value = 'sender.author.organization.country' and answer.exists()) -> organization.address as address share orgAddress, address.country = (item.answer.value) "sender.author.organization.country";\n}\n\ngroup SenderAuthorItems(source src : BackboneElement, target practitionerRole: practitionerRole, target practitioner : Practitioner, target organization: Organization) {\n src.item as item where (linkId.value = 'sender.author.practitioner') then SenderAuthorPractitionerItems(item, practitioner);\n src.item as item where (linkId.value = 'sender.author.organization') then SenderAuthorOrganizationItems(item, organization);\n}\n\ngroup SenderDataEntererPractitionerItems(source src : BackboneElement, target practitioner: Practitioner) {\n src.item as item where (linkId.value = 'sender.dataenterer.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'sender.dataenterer.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'sender.dataenterer.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "sender.author.practitioner.phone"; \n src.item as item where (linkId.value = 'sender.dataenterer.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "sender.author.practitioner.email"; \n}\n\ngroup SenderDataEntererItems(source src : BackboneElement, target practitionerRole: practitionerRole, target practitioner : Practitioner, target organization: Organization) {\n src.item as item where (linkId.value = 'sender.dataenterer.practitioner') then SenderDataEntererPractitionerItems(item, practitioner);\n}\n\ngroup ChExtEprDataEnterer(source src: BackboneElement, target practitionerRole: PractitionerRole, target ext: Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-dataenterer' "url";\n src -> ext.extension as ext, ext.url='enterer', ext.value = create('Reference') as reference, \n reference.reference = ('urn:uuid:'+%practitionerRole.id) "practitionerRole";\n}\n\ngroup SenderAuthorInit(source src : BackboneElement, target bundle: Bundle, target composition : Composition, target serviceRequest: ServiceRequest) {\n src -> bundle.entry as e, \n e.resource = create('PractitionerRole') as practitionerRole, \n practitionerRole.id = uuid() as uuid,\n e.fullUrl = append('urn:uuid:',uuid),\n bundle.entry as e2, \n e2.resource = create('Practitioner') as practitioner, \n practitioner.id = uuid() as uuid2,\n e2.fullUrl = append('urn:uuid:',uuid2),\n bundle.entry as e3, \n e3.resource = create('Organization') as organization, \n organization.id = uuid() as uuid3,\n e3.fullUrl = append('urn:uuid:',uuid3),\n composition.author = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid),\n serviceRequest.requester = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid),\n practitionerRole.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid2),\n practitionerRole.organization = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid3) then {\n src.item as item where (linkId.value = 'sender.author') then SenderAuthorItems(item, practitionerRole, practitioner, organization) "sender.author";\n src.item as item where (linkId.value = 'sender.dataenterer') then {\n item -> bundle.entry as e4, \n e4.resource = create('PractitionerRole') as practitionerRoleDataEnterer, \n practitionerRoleDataEnterer.id = uuid() as uuid4,\n e4.fullUrl = append('urn:uuid:',uuid4),\n composition.extension as extension,\n bundle.entry as e5, \n e5.resource = create('Practitioner') as practitionerDataEnterer, \n practitionerDataEnterer.id = uuid() as uuid5,\n e5.fullUrl = append('urn:uuid:',uuid5),\n practitionerRoleDataEnterer.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid5),\n practitionerRoleDataEnterer.organization = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid3) \n then {\n item then SenderDataEntererItems(item, practitionerRoleDataEnterer, practitionerDataEnterer, organization) "data";\n item then ChExtEprDataEnterer(item, practitionerRoleDataEnterer, extension) "extension";\n } "sender.dataenterer.items";\n } "sender.dataenterer";\n } "sender";\n}\n\ngroup ReceiverCopyRelatedPersonItems(source src : BackboneElement, target relatedPerson: RelatedPerson) {\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.familyName' and answer.exists()) -> relatedPerson.name as name share name, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.givenName' and answer.exists()) -> relatedPerson.name as name share name, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.phone' and answer.exists()) then {\n item.answer as answer -> relatedPerson.telecom as value, value.system = 'phone',\n value.value= (answer.value) "receiverCopy.relatedPerson.phone"; \n } "phone";\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.email' and answer.exists()) -> relatedPerson.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "receiverCopy.relatedPerson.email"; \n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.streetAddressLine' and answer.exists()) -> relatedPerson.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "receiverCopy.relatedPerson.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.postalCode' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.postalCode = (item.answer.value) "receiverCopy.relatedPerson.postalCode";\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.city' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.city = (item.answer.value) "receiverCopy.relatedPerson.city";\n src.item as item where (linkId.value = 'receiverCopy.relatedPerson.country' and answer.exists()) -> relatedPerson.address as address share orgAddress, address.country = (item.answer.value) "receiverCopy.relatedPerson.country";\n}\n\ngroup ReceiverCopyPractitionerItems(source src : BackboneElement, target practitioner : Practitioner) {\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.practitioner.familyName' and answer.exists()) -> practitioner.name as name share practitionerName, name.family = (item.answer.value);\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.practitioner.givenName' and answer.exists()) -> practitioner.name as name share practitionerName, name.given = (item.answer.value);\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.practitioner.title' and answer.exists()) -> practitioner.name as name share practitionerName, \n name.prefix = (item.answer.value) as prefix,\n prefix.extension as ext, ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier',\n ext.value = create('code') as value, value.value='AC' "receiverCopy.practitionerRole.practitioner.title"; \n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.practitioner.phone' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'phone',\n value.value=(item.answer.value) "receiverCopy.practitionerRole.practitioner.phone"; \n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.practitioner.email' and answer.exists()) -> practitioner.telecom as value, \n value.system = 'email',\n value.value=(item.answer.value) "receiverCopy.practitionerRole.practitioner.email"; \n}\n\ngroup ReceiverCopyOrganizationItems(source src : BackboneElement, target organization : Organization) {\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.organization.name' and answer.exists()) -> organization.name = (item.answer.value);\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.organization.streetAddressLine' and answer.exists()) -> organization.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "receiverCopy.practitionerRole.organization.streetAddressLine";\n } "item.answer";\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.organization.postalCode' and answer.exists()) -> organization.address as address share orgAddress, address.postalCode = (item.answer.value) "receiverCopy.practitionerRole.organization.postalCode";\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.organization.city' and answer.exists()) -> organization.address as address share orgAddress, address.city = (item.answer.value) "receiverCopy.practitionerRole.organization.city";\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.organization.country' and answer.exists()) -> organization.address as address share orgAddress, address.country = (item.answer.value) "receiverCopy.practitionerRole.organization.country";\n}\n\ngroup ReceiverCopyPractitionerRoleItems(source src : BackboneElement, target bundle: Bundle, target practitionerRole: practitionerRole) {\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.practitioner') -> \n bundle.entry as e2, \n e2.resource = create('Practitioner') as practitioner, \n practitioner.id = uuid() as uuid2,\n practitionerRole.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid2),\n e2.fullUrl = append('urn:uuid:',uuid2) then ReceiverCopyPractitionerItems(item, practitioner);\n src.item as item where (linkId.value = 'receiverCopy.practitionerRole.organization') ->\n bundle.entry as e3, \n e3.resource = create('Organization') as organization, \n organization.id = uuid() as uuid3,\n practitionerRole.organization = create('Reference') as reference, reference.reference = append('urn:uuid:',uuid3), \n e3.fullUrl = append('urn:uuid:',uuid3) then ReceiverCopyOrganizationItems(item, organization);\n}\n\ngroup ExtOrfCopyReceiverPatient(source src: BackboneElement, target patient: Patient, target ext: Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-copyreceiver' "url";\n src -> ext.value = create('Reference') as reference, \n reference.reference = ('urn:uuid:'+%patient.id) "patient";\n}\n\ngroup ExtOrfCopyReceiver(source src: BackboneElement, target res, target ext: Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-copyreceiver' "url";\n src -> ext.value = create('Reference') as reference, \n reference.reference = ('urn:uuid:'+%res.id) "organization";\n}\n\ngroup ReceiverCopy(source grp : BackboneElement, target bundle: Bundle, target patient: Patient, target composition : Composition, target serviceRequest: ServiceRequest) {\n grp.item as item where (linkId='receiverCopy.practitionerRole') -> bundle.entry as e4, \n e4.resource = create('PractitionerRole') as practitionerrole, \n composition.extension as extension,\n practitionerrole.id = uuid() as uuid4,\n e4.fullUrl = append('urn:uuid:',uuid4) then {\n item then ReceiverCopyPractitionerRoleItems(item, bundle, practitionerrole) "data";\n item then ExtOrfCopyReceiver(item, practitionerrole, extension) "extension";\n } "receiverCopyPractitionerRole1";\n grp.item as item where (linkId='receiverCopy.patient') -> \n composition.extension as extension then {\n item then ExtOrfCopyReceiver(item, patient, extension) "extension";\n } "receiverCopyPractitionerRole2";\n grp.item as item where (linkId='receiverCopy.relatedPerson') -> bundle.entry as e4, \n e4.resource = create('RelatedPerson') as relatedPerson, \n composition.extension as extension,\n relatedPerson.id = uuid() as uuid4,\n relatedPerson.patient as reference,\n reference.reference = ('urn:uuid:'+%patient.id),\n e4.fullUrl = append('urn:uuid:',uuid4) then {\n item then ReceiverCopyRelatedPersonItems(item, relatedPerson) "data";\n item then ExtOrfCopyReceiver(item, relatedPerson, extension) "extension";\n } "receiverCopyPractitionerRole3";\n}\n\ngroup Appointment(source grp : BackboneElement, target bundle: Bundle, target composition : Composition, target serviceRequest: ServiceRequest) {\n grp.item -> bundle.entry as e4, \n e4.resource = create('Appointment') as appointment, \n appointment.id = uuid() as uuid4,\n e4.fullUrl = ('urn:uuid:'+%uuid4),\n serviceRequest.extension as extension,\n extension.url = 'http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-locationandtime',\n extension.value = create('Reference') as reference, reference.reference = ('urn:uuid:'+%uuid4) \n then {\n grp.item as item where (linkId.value = 'appointment.status' and answer.value.code='proposed') -> appointment.status = (item.answer.value.code) then {\n grp.item as itemp where (linkId.value = 'appointment.requestedPeriod') then {\n itemp.item as item2 where (linkId.value = 'appointment.requestedPeriod.start' and answer.exists()) -> appointment.requestedPeriod as requestedPeriod, requestedPeriod.start = (item2.answer.value), requestedPeriod.end = (item2.answer.value) then {\n itemp.item as item3 where (linkId.value = 'appointment.requestedPeriod.end' and answer.exists()) -> requestedPeriod.end = (item3.answer.value) "appointment.requestedPeriod.end.if.not.same.as.start";\n } "appointment.requestedPeriod.start";\n } "appointment.requestedPeriod";\n } "proposed";\n grp.item as item where (linkId.value = 'appointment.status' and (answer.value.code='pending' or answer.value.code='booked')) -> appointment.status = (item.answer.value.code) then {\n grp.item as itemp where (linkId.value = 'appointment.requestedPeriod') then {\n itemp.item as item2 where (linkId.value = 'appointment.requestedPeriod.start' and answer.exists()) -> appointment.start = (item2.answer.value), appointment.end = (item2.answer.value) then {\n itemp.item as item3 where (linkId.value = 'appointment.requestedPeriod.end' and answer.exists()) -> appointment.end = (item3.answer.value) "appointment.end.if.not.same.as.start";\n } "appointment.start";\n } "appointment.startend";\n } "pendingorbooked";\n grp.item as item where (linkId.value = 'appointment.patientInstruction' and answer.exists()) -> appointment.patientInstruction = (item.answer.value) "appointment.patientInstruction";\n grp.item as item where (linkId.value = 'appointment.location') then {\n item -> bundle.entry as e5, \n e5.resource = create('Location') as location, \n location.id = uuid() as uuid5,\n e5.fullUrl = ('urn:uuid:'+%uuid5),\n appointment.participant as participant, participant.status = 'tentative', participant.actor = create('Reference') as actor, actor.reference = ('urn:uuid:'+%location.id) then {\n item.item as item3 where (linkId.value = 'appointment.location.name' and answer.exists()) -> location.name = (item3.answer.value);\n item.item as item3 where (linkId.value = 'appointment.location.phone' and answer.exists()) -> location.telecom as value, value.system = 'phone', value.value=(item3.answer.value) "appointment.location.phone"; \n item.item as item3 where (linkId.value = 'appointment.location.email' and answer.exists()) -> location.telecom as value, value.system = 'email', value.value=(item3.answer.value) "appointment.location.email"; \n item.item as item3 where (linkId.value = 'appointment.location.streetAddressLine' and answer.exists()) -> location.address as address share orgAddress then {\n item.answer as answer -> address.line = (answer.value) "line";\n } "appointment.location.streetAddressLine";\n item.item as item3 where (linkId.value = 'appointment.location.postalCode' and answer.exists()) -> location.address as address share orgAddress, address.postalCode = (item3.answer.value) "appointment.location.postalCode";\n item.item as item3 where (linkId.value = 'appointment.location.city' and answer.exists()) -> location.address as address share orgAddress, address.city = (item3.answer.value) "appointment.location.city";\n item.item as item3 where (linkId.value = 'appointment.location.country' and answer.exists()) -> location.address as address share orgAddress, address.country = (item3.answer.value) "appointment.location.country";\n } "location";\n } "appointment.location";\n } "Appointment";\n}\n\ngroup PreviousResults(source grp : BackboneElement, target bundle: Bundle, target serviceRequest: ServiceRequest) {\n grp.item as item where (linkId='previousResults.attachment' and answer.exists()) then {\n item.answer as answer then {\n answer.value: Attachment as attachment -> \n bundle.entry as e, \n e.resource = create('Media') as media, \n media.id = uuid() as uuid,\n media.status = 'completed',\n e.fullUrl = append('urn:uuid:',uuid), \n media.content = attachment,\n serviceRequest.supportingInfo as supportingInfo,\n supportingInfo.reference = ('urn:uuid:'+uuid)\n "media"; \n } "answer";\n } "item";\n}\n\ngroup Note(source grp : BackboneElement, target serviceRequest: ServiceRequest) {\n grp.item as item where (linkId='note.text' and answer.exists()) -> serviceRequest.note as note, note.text = (item.answer.value) "note.text";\n}\n\ngroup QrToBundle(source qr : QuestionnaireResponse, target q: Questionnaire, target patient : Patient, target questionnaireresp: QuestionnaireResponseTarget, target servicerequest: ServiceRequest, target composition : Composition, target bundle : Bundle) {\n qr -> bundle.id = uuid() "id";\n qr -> bundle.type = 'document' "type";\n qr then OrfComposition(qr, q, composition, patient, questionnaireresp, servicerequest, bundle) "composition";\n qr then QrToGroups(qr, patient, bundle, composition, servicerequest) "qrgroups";\n}\n\ngroup OrfComposition(source qr : QuestionnaireResponse, target q: Questionnaire, target tgt : Composition, target patient: Patient, target questionnaireresp: QuestionnaireResponseTarget, target servicerequest: ServiceRequest, target bundle : Bundle) {\n qr -> tgt.status = 'final' "status";\n qr -> tgt.subject = create('Reference') as reference, reference.reference = ('urn:uuid:'+%patient.id) "subject";\n qr -> tgt.section as tgtSection, \n tgtSection.title = 'Order-Referral', \n tgtSection.code as code, code.coding as coding, coding.system='http://loinc.org', coding.code='93037-0', coding.display='Portable medical order form',\n tgtSection.entry = create('Reference') as reference, reference.reference = ('urn:uuid:'+%questionnaireresp.id),\n tgtSection.entry = create('Reference') as reference, reference.reference = ('urn:uuid:'+%servicerequest.id),\n tgtSection.entry = create('Reference') as reference, reference.reference = ('urn:uuid:'+%q.id) "sections";\n qr -> servicerequest.status = 'active',\n servicerequest.intent = 'order',\n servicerequest.subject = create('Reference') as reference, reference.reference = ('urn:uuid:'+%patient.id) "servicerequest";\n}</pre>\n </div>"
},
"url" : "http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle",
"version" : "2.0.0-ballot",
"name" : "OrfQrToBundle",
"status" : "draft",
"date" : "2023-06-29T21:20:25+02:00",
"publisher" : "HL7 Switzerland",
"contact" : [
{
"name" : "HL7 Switzerland",
"telecom" : [
{
"system" : "url",
"value" : "https://www.hl7.ch/"
}
]
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "urn:iso:std:iso:3166",
"code" : "CH"
}
]
}
],
"copyright" : "CC0-1.0",
"structure" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
"mode" : "source",
"alias" : "QuestionnaireResponse"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/BackboneElement",
"mode" : "source",
"alias" : "BackboneElement"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
"mode" : "target",
"alias" : "Bundle"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Composition",
"mode" : "target",
"alias" : "Composition"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "target",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
"mode" : "target",
"alias" : "RelatedPerson"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Organization",
"mode" : "target",
"alias" : "Organization"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
"mode" : "target",
"alias" : "Practitioner"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
"mode" : "target",
"alias" : "PractitionerRole"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/ServiceRequest",
"mode" : "target",
"alias" : "ServiceRequest"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Extension",
"mode" : "target",
"alias" : "Extension"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare",
"mode" : "target",
"alias" : "EpisodeOfCare"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
"mode" : "target",
"alias" : "QuestionnaireResponseTarget"
}
],
"group" : [
{
"name" : "OrfQrToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "qr",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "documentIdentifier",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "identifier",
"variable" : "documentIdentifier"
},
{
"context" : "documentIdentifier",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:ietf:rfc:3986"
}
]
},
{
"contextType" : "variable",
"variable" : "uuidDoc",
"transform" : "uuid"
},
{
"context" : "documentIdentifier",
"contextType" : "variable",
"element" : "value",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuidDoc"
}
]
}
]
},
{
"name" : "orfbundle",
"source" : [
{
"context" : "qr",
"variable" : "qrcp"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "composition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "timestamp",
"variable" : "timestamp",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "now()"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "date",
"transform" : "copy",
"parameter" : [
{
"valueId" : "timestamp"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "title",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Order and Referral by Form"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "419891008"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://snomed.info/sct"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "category",
"variable" : "category"
},
{
"context" : "category",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "721963009"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://snomed.info/sct"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "patient",
"transform" : "create",
"parameter" : [
{
"valueString" : "Patient"
}
]
},
{
"context" : "patient",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "questionnaireresp",
"transform" : "copy",
"parameter" : [
{
"valueId" : "qrcp"
}
]
},
{
"context" : "questionnaireresp",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "servicerequest",
"transform" : "create",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
}
],
"rule" : [
{
"name" : "orfbundle",
"source" : [
{
"context" : "qr",
"element" : "questionnaire",
"variable" : "can"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e6"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "resource",
"variable" : "q",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "can.resolve()"
}
]
},
{
"context" : "q",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid6",
"transform" : "uuid"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid6"
}
]
}
],
"dependent" : [
{
"name" : "QrToBundle",
"variable" : [
"qr",
"q",
"patient",
"questionnaireresp",
"servicerequest",
"composition",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "QrToGroups",
"typeMode" : "none",
"input" : [
{
"name" : "qr",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "grporder",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'order'"
}
],
"dependent" : [
{
"name" : "OrderItems",
"variable" : [
"grp",
"bundle",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "receiver",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'receiver'"
}
],
"dependent" : [
{
"name" : "ReceiverInit",
"variable" : [
"grp",
"bundle",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "grpinitiator",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'initiator'"
}
],
"dependent" : [
{
"name" : "InitiatorInit",
"variable" : [
"grp",
"bundle",
"patient",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "grppatient",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'patient'"
}
],
"dependent" : [
{
"name" : "PatientItems",
"variable" : [
"grp",
"bundle",
"patient",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "grprequestedencounter",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'requestedEncounter'"
}
],
"dependent" : [
{
"name" : "RequestedEncounterItems",
"variable" : [
"grp",
"bundle",
"patient",
"serviceRequest"
]
}
]
},
{
"name" : "grprequestedencounter",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'coverage'"
}
],
"dependent" : [
{
"name" : "Coverage",
"variable" : [
"grp",
"bundle",
"patient",
"serviceRequest"
]
}
]
},
{
"name" : "grpsender",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'sender'"
}
],
"dependent" : [
{
"name" : "SenderAuthorInit",
"variable" : [
"grp",
"bundle",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "receiverCopy",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'receiverCopy'"
}
],
"dependent" : [
{
"name" : "ReceiverCopy",
"variable" : [
"grp",
"bundle",
"patient",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "appointment",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'appointment'"
}
],
"dependent" : [
{
"name" : "Appointment",
"variable" : [
"grp",
"bundle",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "previousResults",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'previousResults'"
}
],
"dependent" : [
{
"name" : "PreviousResults",
"variable" : [
"grp",
"bundle",
"serviceRequest"
]
}
]
},
{
"name" : "AntecedentEpisodeOfCareInit",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'antecedentEpisodeOfCare'"
}
],
"dependent" : [
{
"name" : "AntecedentEpisodeOfCareInit",
"variable" : [
"grp",
"bundle",
"patient",
"composition"
]
}
]
},
{
"name" : "consent",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'consent'"
}
],
"dependent" : [
{
"name" : "Consent",
"variable" : [
"grp",
"bundle",
"composition"
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "qr",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'note'"
}
],
"dependent" : [
{
"name" : "Note",
"variable" : [
"grp",
"serviceRequest"
]
}
]
}
]
},
{
"name" : "OrderItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "order.precedentDocumentIdentifier",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.precedentDocumentIdentifier') and answer.exists())"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-precedentdocument"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Identifier"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:ietf:rfc:3986"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + item.answer.valueString"
}
]
}
]
},
{
"name" : "order.placerOrderIdentifier",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.placerOrderIdentifier') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value",
"listMode" : [
"share"
],
"listRuleId" : "placer"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v2-0203"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PLAC"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.valueString"
}
]
}
]
},
{
"name" : "order.placerOrderIdentifierDomain",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.placerOrderIdentifierDomain') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value",
"listMode" : [
"share"
],
"listRuleId" : "placer"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.valueString"
}
]
}
]
},
{
"name" : "order.fillerOrderIdentifier",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.fillerOrderIdentifier') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value",
"listMode" : [
"share"
],
"listRuleId" : "filler"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v2-0203"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "FILL"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.valueString"
}
]
}
]
},
{
"name" : "order.fillerOrderIdentifierDomain",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.fillerOrderIdentifierDomain') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value",
"listMode" : [
"share"
],
"listRuleId" : "filler"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.valueString"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.dateTime') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "authoredOn",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.priority') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "priority",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value.code"
}
]
}
]
},
{
"name" : "order.notificationContactDocument",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'order.notificationContactDocument')"
}
],
"rule" : [
{
"name" : "order.notificationContactDocument.items",
"source" : [
{
"context" : "item"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRoleDataEnterer",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerDataEnterer",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitionerDataEnterer",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "UrgentNotificationContactForRequestItems",
"variable" : [
"item",
"practitionerRoleDataEnterer",
"practitionerDataEnterer"
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ExtOrfUrgentNotificationContactForRequest",
"variable" : [
"item",
"practitionerRoleDataEnterer",
"extension"
]
}
]
}
]
}
]
},
{
"name" : "order.notificationContactDocumentResponse",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'order.notificationContactDocumentResponse')"
}
],
"rule" : [
{
"name" : "order.notificationContactDocumentResponse.items",
"source" : [
{
"context" : "item"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRoleDataEnterer",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerDataEnterer",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitionerDataEnterer",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "UrgentNotificationContactForResponseItems",
"variable" : [
"item",
"practitionerRoleDataEnterer",
"practitionerDataEnterer"
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ExtOrfUrgentNotificationContactForResponse",
"variable" : [
"item",
"practitionerRoleDataEnterer",
"extension"
]
}
]
}
]
}
]
}
]
},
{
"name" : "UrgentNotificationContactForRequestPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocument.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocument.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocument.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "sender.author.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocument.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocument.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "UrgentNotificationContactForRequestItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'order.notificationContactDocument.practitioner')"
}
],
"dependent" : [
{
"name" : "UrgentNotificationContactForRequestPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
}
]
},
{
"name" : "ExtOrfUrgentNotificationContactForRequest",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "PractitionerRole",
"mode" : "target"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-urgentnoficationcontactforthisdocument"
}
]
}
]
},
{
"name" : "practitionerRole",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitionerRole.id"
}
]
}
]
}
]
},
{
"name" : "UrgentNotificationContactForResponsePractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocumentResponse.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocumentResponse.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocumentResponse.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "sender.author.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocumentResponse.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'order.notificationContactDocumentResponse.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "UrgentNotificationContactForResponseItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'order.notificationContactDocumentResponse.practitioner')"
}
],
"dependent" : [
{
"name" : "UrgentNotificationContactForResponsePractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
}
]
},
{
"name" : "ExtOrfUrgentNotificationContactForResponse",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "PractitionerRole",
"mode" : "target"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-urgentnoficationcontactfortheresponsetothisdocument"
}
]
}
]
},
{
"name" : "practitionerRole",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitionerRole.id"
}
]
}
]
}
]
},
{
"name" : "ReceiverPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "receiver.practitioner.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.practitioner.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "ReceiverOrganizationItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.name') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.organization.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.organization.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "receiver.organization.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "receiver.organization.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.organization.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.city') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.organization.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiver.organization.country') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "ReceiverItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'receiver.practitioner')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"dependent" : [
{
"name" : "ReceiverPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'receiver.organization')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "organization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"dependent" : [
{
"name" : "ReceiverOrganizationItems",
"variable" : [
"item",
"organization"
]
}
]
}
]
},
{
"name" : "Consent",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
}
],
"rule" : [
{
"name" : "consent.statement",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'consent.statement') and answer.exists())"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "consent",
"transform" : "create",
"parameter" : [
{
"valueString" : "Consent"
}
]
},
{
"context" : "consent",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "consent",
"contextType" : "variable",
"element" : "scope",
"variable" : "scope"
},
{
"context" : "scope",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "treatment"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/consentscope"
}
]
},
{
"context" : "consent",
"contextType" : "variable",
"element" : "category",
"variable" : "category"
},
{
"context" : "category",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "59284-0"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://loinc.org"
}
]
},
{
"context" : "consent",
"contextType" : "variable",
"element" : "policyRule",
"variable" : "policyRule"
},
{
"context" : "policyRule",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "385432009"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://snomed.info/sct"
}
]
},
{
"context" : "consent",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-patientconsent"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "consent",
"contextType" : "variable",
"element" : "extension",
"variable" : "extcode"
},
{
"context" : "extcode",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-consentcode"
}
]
},
{
"context" : "extcode",
"contextType" : "variable",
"element" : "value",
"variable" : "cc",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
},
{
"context" : "cc",
"contextType" : "variable",
"element" : "coding",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
}
],
"rule" : [
{
"name" : "item.answer",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"rule" : [
{
"name" : "consent.statement.note",
"source" : [
{
"context" : "answer",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'consent.statement.note') and answer.exists())"
}
],
"target" : [
{
"context" : "consent",
"contextType" : "variable",
"element" : "extension",
"variable" : "extnote"
},
{
"context" : "extnote",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-consentnote"
}
]
},
{
"context" : "extnote",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ReceiverInit",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "receiver",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRole",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-receiver"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
}
],
"dependent" : [
{
"name" : "ReceiverItems",
"variable" : [
"src",
"bundle",
"practitionerRole"
]
}
]
}
]
},
{
"name" : "InitiatorItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "initiator.personalrelation",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.personalrelation') and answer.exists())"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ch-orf-personalrelation"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.legalrelation",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.legalrelation') and answer.exists())"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ch-orf-legalrelation"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "InitiatorPractitionerRoleItems",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId = 'initiator.practitionerRole')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerrole",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "practitionerrole",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ch-orf-personorganization"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "InitiatorPractitionerRoleItems",
"variable" : [
"item",
"bundle",
"practitionerrole"
]
}
]
}
]
},
{
"name" : "initiator.relatedPerson",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId = 'initiator.relatedPerson')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "relatedPerson",
"transform" : "create",
"parameter" : [
{
"valueString" : "RelatedPerson"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ch-orf-personorganization"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference"
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "InitiatorRelatedPersonItems",
"variable" : [
"item",
"relatedPerson"
]
}
]
}
]
}
]
},
{
"name" : "InitiatorRelatedPersonItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "relatedPerson",
"type" : "RelatedPerson",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.phone') and answer.exists())"
}
],
"rule" : [
{
"name" : "initiator.relatedPerson.phone",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "initiator.relatedPerson.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.email') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "initiator.relatedPerson.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "initiator.relatedPerson.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.relatedPerson.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.city') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.relatedPerson.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.relatedPerson.country') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "InitiatorPractitionerRoleItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'initiator.practitionerRole.practitioner')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"dependent" : [
{
"name" : "InitiatorPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'initiator.practitionerRole.organization')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "organization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"dependent" : [
{
"name" : "InitiatorOrganizationItems",
"variable" : [
"item",
"organization"
]
}
]
}
]
},
{
"name" : "InitiatorPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.practitionerRole.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "initiator.practitionerRole.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.practitionerRole.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.practitioner.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiver.practitioner.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.practitioner.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "InitiatorOrganizationItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.organization.name') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.organization.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "initiator.practitionerRole.organization.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "initiator.practitionerRole.organization.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.organization.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.practitionerRole.organization.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.organization.city') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "initiator.practitionerRole.organization.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'initiator.practitionerRole.organization.country') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "FamilyDoctorInit",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "FamilyDoctorInit",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRole",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "patient",
"contextType" : "variable",
"element" : "generalPractitioner",
"variable" : "gp",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "gp",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'familydoctor.practitioner')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"dependent" : [
{
"name" : "FamilyDoctorPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'familydoctor.organization')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "organization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"dependent" : [
{
"name" : "FamilyDoctorOrganizationItems",
"variable" : [
"item",
"organization"
]
}
]
}
]
}
]
},
{
"name" : "FamilyDoctorPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.practitioner.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.practitioner.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "familydoctor.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "FamilyDoctorOrganizationItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.name') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "familydoctor.organization.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "familydoctor.organization.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.organization.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.city') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.organization.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.country') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctor.organization.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "familydoctorr.organization.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'familydoctor.organization.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "AntecedentEpisodeOfCareInit",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
}
],
"rule" : [
{
"name" : "AntecedentEpisodeOfCareItems",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-antecedentepisodeofcare"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "episodeofcare",
"transform" : "create",
"parameter" : [
{
"valueString" : "EpisodeOfCare"
}
]
},
{
"context" : "episodeofcare",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "episodeofcare",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "ref",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "ref",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %episodeofcare.id"
}
]
}
],
"dependent" : [
{
"name" : "AntecedentEpisodeOfCareItems",
"variable" : [
"src",
"bundle",
"patient",
"episodeofcare"
]
}
]
}
]
},
{
"name" : "AntecedentEpisodeOfCareItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "episodeofcare",
"type" : "EpisodeOfCare",
"mode" : "target"
}
],
"rule" : [
{
"name" : "antecedentEpisodeOfCare.requestedPeriod.start",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.start') and answer.exists())"
}
],
"target" : [
{
"context" : "episodeofcare",
"contextType" : "variable",
"element" : "statusHistory",
"variable" : "statusHistory"
},
{
"context" : "statusHistory",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
},
{
"context" : "statusHistory",
"contextType" : "variable",
"element" : "period",
"variable" : "period"
},
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "period",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
],
"rule" : [
{
"name" : "antecedentEpisodeOfCareEndNotSameAsStart",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "iteme",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.end') and answer.exists())"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "iteme.answer.value"
}
]
}
]
}
]
},
{
"name" : "antecedentEpisodeOfCare.managingOrganization",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'antecedentEpisodeOfCare.managingOrganization')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "episodeofcare",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %tgt.id"
}
]
},
{
"context" : "episodeofcare",
"contextType" : "variable",
"element" : "managingOrganization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"dependent" : [
{
"name" : "AntecedentEpisodeOfCareOrganizationItems",
"variable" : [
"item",
"organization"
]
}
]
}
]
},
{
"name" : "AntecedentEpisodeOfCareOrganizationItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.name') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "antecedentEpisodeOfCareorganization.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "sender.author.organization.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.organization.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.city') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.organization.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'antecedentEpisodeOfCare.managingOrganization.country') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "InitiatorInit",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "receiver",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-initiator"
}
]
}
],
"dependent" : [
{
"name" : "InitiatorItems",
"variable" : [
"src",
"bundle",
"patient",
"ext"
]
}
]
}
]
},
{
"name" : "PatientItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "grpfamily",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "grp",
"condition" : "linkId = 'familydoctor'"
}
],
"dependent" : [
{
"name" : "FamilyDoctorInit",
"variable" : [
"grp",
"bundle",
"tgt",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item"
}
],
"dependent" : [
{
"name" : "PatientItems",
"variable" : [
"item",
"bundle",
"tgt",
"composition",
"serviceRequest"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "patientName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.maidenName') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "name",
"variable" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "use",
"transform" : "copy",
"parameter" : [
{
"valueString" : "maiden"
}
]
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "patientName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "patient.localPid",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.localPid') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value",
"listMode" : [
"share"
],
"listRuleId" : "localpid"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v2-0203"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MR"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.valueString"
}
]
}
]
},
{
"name" : "patient.localPidDomain",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.localPidDomain') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value",
"listMode" : [
"share"
],
"listRuleId" : "localpid"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.valueString"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.birthDate') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "birthDate",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.gender') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "gender",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value.code"
}
]
}
]
},
{
"name" : "patient.maritalStatus",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.maritalStatus') and answer.exists())"
}
],
"rule" : [
{
"name" : "answer",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"rule" : [
{
"name" : "maritalStatus",
"source" : [
{
"context" : "answer",
"type" : "Coding",
"element" : "value",
"variable" : "coding"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "maritalStatus",
"variable" : "maritalStatus"
},
{
"context" : "maritalStatus",
"contextType" : "variable",
"element" : "coding",
"transform" : "copy",
"parameter" : [
{
"valueId" : "coding"
}
]
}
]
}
]
}
]
},
{
"name" : "patient.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.phone') and answer.exists())"
}
],
"rule" : [
{
"name" : "patient.phone",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "patient.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.email') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "patient.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "patient.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "patient.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.city') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "patient.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.country') and answer.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "patient.languageOfCorrespondence",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.languageOfCorrespondence') and answer.exists())"
}
],
"rule" : [
{
"name" : "answer",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"rule" : [
{
"name" : "languageOfCorrespondence",
"source" : [
{
"context" : "answer",
"type" : "Coding",
"element" : "value",
"variable" : "coding"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "communication",
"variable" : "communication"
},
{
"context" : "communication",
"contextType" : "variable",
"element" : "preferred",
"transform" : "copy",
"parameter" : [
{
"valueBoolean" : true
}
]
},
{
"context" : "communication",
"contextType" : "variable",
"element" : "language",
"variable" : "language"
},
{
"context" : "language",
"contextType" : "variable",
"element" : "coding",
"transform" : "copy",
"parameter" : [
{
"valueId" : "coding"
}
]
}
]
}
]
}
]
},
{
"name" : "contact",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'patient.contactperson')"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "contact",
"variable" : "contact"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.contactperson.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "contact",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "contactName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.contactperson.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "contact",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "contactName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "patient.contactperson.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.contactperson.phone') and answer.exists())"
}
],
"rule" : [
{
"name" : "patient.phone",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "patient.email",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.contactperson.email') and answer.exists())"
}
],
"target" : [
{
"context" : "contact",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "patient.contactperson.relationship",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'patient.contactperson.relationship') and answer.exists())"
}
],
"target" : [
{
"context" : "contact",
"contextType" : "variable",
"element" : "relationship",
"variable" : "relationship"
},
{
"context" : "relationship",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
}
]
},
{
"name" : "RequestedEncounterItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "RequestedEncounterItems",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "encounter",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "planned"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "subject",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-requestedencounterdetails"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
}
],
"rule" : [
{
"name" : "requestedEncounter.class",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'requestedEncounter.class') and answer.exists())"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "class",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "requestedEncounter.desiredAccommodation",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'requestedEncounter.desiredAccommodation') and answer.exists())"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-desiredaccommodation"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
}
]
},
{
"name" : "Coverage",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "coverage.beneficiary",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.beneficiary')"
}
],
"rule" : [
{
"name" : "coverage.beneficiary.ahvn13",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.beneficiary.ahvn13') and answer.exists())"
}
],
"target" : [
{
"context" : "patient",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.32"
}
]
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "coveragekvg",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.kvg')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "KVG"
}
]
}
],
"rule" : [
{
"name" : "coverage.kvg.name",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.kvg.name') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "payor"
},
{
"context" : "payor",
"contextType" : "variable",
"element" : "reference",
"variable" : "refcontained"
},
{
"context" : "refcontained",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "#org"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "contained",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"transform" : "copy",
"parameter" : [
{
"valueString" : "org"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "coverage.kvg.insuranceCardNumber",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.kvg.insuranceCardNumber') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "type",
"variable" : "typeid"
},
{
"context" : "typeid",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "VeKa"
}
]
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "coverageuvg",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.uvg')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "UVG"
}
]
}
],
"rule" : [
{
"name" : "coverage.uvg.name",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.uvg.name') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "payor"
},
{
"context" : "payor",
"contextType" : "variable",
"element" : "reference",
"variable" : "refcontained"
},
{
"context" : "refcontained",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "#org"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "contained",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"transform" : "copy",
"parameter" : [
{
"valueString" : "org"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "coverage.uvg.claimNumber",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.uvg.claimNumber') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "type",
"variable" : "typeid"
},
{
"context" : "typeid",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Claim"
}
]
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "coveragevvg",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.vvg')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "VVG"
}
]
}
],
"rule" : [
{
"name" : "coverage.vvg.name",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.vvg.name') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "payor"
},
{
"context" : "payor",
"contextType" : "variable",
"element" : "reference",
"variable" : "refcontained"
},
{
"context" : "refcontained",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "#org"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "contained",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"transform" : "copy",
"parameter" : [
{
"valueString" : "org"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "coverage.vvg.insuranceCardNumber",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.vvg.insuranceCardNumber') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "type",
"variable" : "typeid"
},
{
"context" : "typeid",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "VeKa"
}
]
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "coverageiv",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.iv')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "IVG"
}
]
}
],
"rule" : [
{
"name" : "coverage.iv.verfuegungsnummer",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.iv.verfuegungsnummer') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "type",
"variable" : "typeid"
},
{
"context" : "typeid",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "IV"
}
]
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "payor"
},
{
"context" : "payor",
"contextType" : "variable",
"element" : "reference",
"variable" : "refcontained"
},
{
"context" : "refcontained",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "#org"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "contained",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"transform" : "copy",
"parameter" : [
{
"valueString" : "org"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "copy",
"parameter" : [
{
"valueString" : "IV"
}
]
}
]
}
]
},
{
"name" : "coveragemv",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.mv')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MVG"
}
]
}
],
"rule" : [
{
"name" : "coverage.mv.versichertennummer",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.mv.versichertennummer') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "type",
"variable" : "typeid"
},
{
"context" : "typeid",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coverageidentifiertype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MV"
}
]
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "payor"
},
{
"context" : "payor",
"contextType" : "variable",
"element" : "reference",
"variable" : "refcontained"
},
{
"context" : "refcontained",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "#org"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "contained",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"transform" : "copy",
"parameter" : [
{
"valueString" : "org"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MV"
}
]
}
]
}
]
},
{
"name" : "self",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.self')"
}
],
"rule" : [
{
"name" : "payor",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.patient') and answer.exists() and answer.value)"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Self"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "subject"
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
}
]
},
{
"name" : "coverage.self.patientrelated.",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item2",
"condition" : "((linkId.value = 'coverage.self.patientRelatedPerson') and answer.exists() and answer.value)"
}
],
"rule" : [
{
"name" : "coverage.self.relatedPerson",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'coverage.self.relatedPerson')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Self"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e6"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "resource",
"variable" : "relatedPerson",
"transform" : "create",
"parameter" : [
{
"valueString" : "RelatedPerson"
}
]
},
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid6",
"transform" : "uuid"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid6"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "subject"
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %relatedPerson.id"
}
]
},
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference"
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
}
],
"dependent" : [
{
"name" : "CoverageRelatedPersonItems",
"variable" : [
"item",
"relatedPerson"
]
}
]
}
]
}
]
},
{
"name" : "coveragevvg",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "where(linkId.value = 'coverage.other')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "insurance",
"variable" : "insurance"
},
{
"context" : "insurance",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "subject",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "subject",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/CodeSystem/ch-orf-cs-coveragetype"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Other"
}
]
}
],
"rule" : [
{
"name" : "coverage.other.name",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.other.name') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "payor"
},
{
"context" : "payor",
"contextType" : "variable",
"element" : "reference",
"variable" : "refcontained"
},
{
"context" : "refcontained",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "#org"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "contained",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"transform" : "copy",
"parameter" : [
{
"valueString" : "org"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "coverage.other.id",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.other.id') and answer.exists())"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
},
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
}
]
},
{
"name" : "CoverageRelatedPersonItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "relatedPerson",
"type" : "RelatedPerson",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.phone') and answer.exists())"
}
],
"rule" : [
{
"name" : "coverage.self.relatedPerson.phone",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "coverage.self.relatedPerson.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.email') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "coverage.self.relatedPerson.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "coverage.self.relatedPerson.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "coverage.self.relatedPerson.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.city') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "coverage.self.relatedPerson.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'coverage.self.relatedPerson.country') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "SenderAuthorPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "sender.author.practitioner.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "recsender.author.practitioner.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "SenderAuthorOrganizationItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.name') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.organization.gln",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.gln') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.51.1.3"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.organization.zsr",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.zsr') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "urn:oid:2.16.756.5.30.1.123.100.2.1.1"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "sender.author.organization.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "sender.author.organization.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.organization.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.city') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.organization.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.author.organization.country') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "SenderAuthorItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'sender.author.practitioner')"
}
],
"dependent" : [
{
"name" : "SenderAuthorPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'sender.author.organization')"
}
],
"dependent" : [
{
"name" : "SenderAuthorOrganizationItems",
"variable" : [
"item",
"organization"
]
}
]
}
]
},
{
"name" : "SenderDataEntererPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.dataenterer.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.dataenterer.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.dataenterer.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "sender.author.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'sender.dataenterer.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "SenderDataEntererItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'sender.dataenterer.practitioner')"
}
],
"dependent" : [
{
"name" : "SenderDataEntererPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
}
]
},
{
"name" : "ChExtEprDataEnterer",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitionerRole",
"type" : "PractitionerRole",
"mode" : "target"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-dataenterer"
}
]
}
]
},
{
"name" : "practitionerRole",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "enterer"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitionerRole.id"
}
]
}
]
}
]
},
{
"name" : "SenderAuthorInit",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "sender",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRole",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "author",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "requester",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "organization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"rule" : [
{
"name" : "sender.author",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'sender.author')"
}
],
"dependent" : [
{
"name" : "SenderAuthorItems",
"variable" : [
"item",
"practitionerRole",
"practitioner",
"organization"
]
}
]
},
{
"name" : "sender.dataenterer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'sender.dataenterer')"
}
],
"rule" : [
{
"name" : "sender.dataenterer.items",
"source" : [
{
"context" : "item"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRoleDataEnterer",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerDataEnterer",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitionerDataEnterer",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "practitionerRoleDataEnterer",
"contextType" : "variable",
"element" : "organization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "SenderDataEntererItems",
"variable" : [
"item",
"practitionerRoleDataEnterer",
"practitionerDataEnterer",
"organization"
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ChExtEprDataEnterer",
"variable" : [
"item",
"practitionerRoleDataEnterer",
"extension"
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ReceiverCopyRelatedPersonItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "relatedPerson",
"type" : "RelatedPerson",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "name"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.phone') and answer.exists())"
}
],
"rule" : [
{
"name" : "receiverCopy.relatedPerson.phone",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "receiverCopy.relatedPerson.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.email') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "receiverCopy.relatedPerson.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "receiverCopy.relatedPerson.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiverCopy.relatedPerson.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.city') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiverCopy.relatedPerson.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.relatedPerson.country') and answer.exists())"
}
],
"target" : [
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "ReceiverCopyPractitionerItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "practitioner",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.practitioner.familyName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.practitioner.givenName') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiverCopy.practitionerRole.practitioner.title",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.practitioner.title') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "name",
"listMode" : [
"share"
],
"listRuleId" : "practitionerName"
},
{
"context" : "name",
"contextType" : "variable",
"element" : "prefix",
"variable" : "prefix",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
},
{
"context" : "prefix",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
}
]
},
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "code"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AC"
}
]
}
]
},
{
"name" : "receiverCopy.practitionerRole.practitioner.phone",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.practitioner.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiverCopy.practitionerRole.practitioner.email",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.practitioner.email') and answer.exists())"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "ReceiverCopyOrganizationItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "organization",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.organization.name') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "item.answer",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.organization.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "receiverCopy.practitionerRole.organization.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "receiverCopy.practitionerRole.organization.postalCode",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.organization.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiverCopy.practitionerRole.organization.city",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.organization.city') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "receiverCopy.practitionerRole.organization.country",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'receiverCopy.practitionerRole.organization.country') and answer.exists())"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "ReceiverCopyPractitionerRoleItems",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "practitionerRole",
"type" : "practitionerRole",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'receiverCopy.practitionerRole.practitioner')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "practitioner",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"dependent" : [
{
"name" : "ReceiverCopyPractitionerItems",
"variable" : [
"item",
"practitioner"
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'receiverCopy.practitionerRole.organization')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "organization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"dependent" : [
{
"name" : "ReceiverCopyOrganizationItems",
"variable" : [
"item",
"organization"
]
}
]
}
]
},
{
"name" : "ExtOrfCopyReceiverPatient",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-copyreceiver"
}
]
}
]
},
{
"name" : "patient",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
}
]
}
]
},
{
"name" : "ExtOrfCopyReceiver",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "res",
"mode" : "target"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-copyreceiver"
}
]
}
]
},
{
"name" : "organization",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %res.id"
}
]
}
]
}
]
},
{
"name" : "ReceiverCopy",
"typeMode" : "none",
"input" : [
{
"name" : "grp",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "receiverCopyPractitionerRole1",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "(linkId = 'receiverCopy.practitionerRole')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerrole",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "practitionerrole",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ReceiverCopyPractitionerRoleItems",
"variable" : [
"item",
"bundle",
"practitionerrole"
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ExtOrfCopyReceiver",
"variable" : [
"item",
"practitionerrole",
"extension"
]
}
]
}
]
},
{
"name" : "receiverCopyPractitionerRole2",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "(linkId = 'receiverCopy.patient')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
}
],
"rule" : [
{
"name" : "extension",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ExtOrfCopyReceiver",
"variable" : [
"item",
"patient",
"extension"
]
}
]
}
]
},
{
"name" : "receiverCopyPractitionerRole3",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "(linkId = 'receiverCopy.relatedPerson')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "relatedPerson",
"transform" : "create",
"parameter" : [
{
"valueString" : "RelatedPerson"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "relatedPerson",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference"
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid4"
}
]
}
],
"rule" : [
{
"name" : "data",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ReceiverCopyRelatedPersonItems",
"variable" : [
"item",
"relatedPerson"
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "item"
}
],
"dependent" : [
{
"name" : "ExtOrfCopyReceiver",
"variable" : [
"item",
"relatedPerson",
"extension"
]
}
]
}
]
}
]
},
{
"name" : "Appointment",
"typeMode" : "none",
"input" : [
{
"name" : "grp",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "Appointment",
"source" : [
{
"context" : "grp",
"element" : "item"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "appointment",
"transform" : "create",
"parameter" : [
{
"valueString" : "Appointment"
}
]
},
{
"context" : "appointment",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension"
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-orf/StructureDefinition/ch-orf-locationandtime"
}
]
},
{
"context" : "extension",
"contextType" : "variable",
"element" : "value",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid4"
}
]
}
],
"rule" : [
{
"name" : "proposed",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'appointment.status') and (answer.value.code = 'proposed'))"
}
],
"target" : [
{
"context" : "appointment",
"contextType" : "variable",
"element" : "status",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value.code"
}
]
}
],
"rule" : [
{
"name" : "appointment.requestedPeriod",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "itemp",
"condition" : "(linkId.value = 'appointment.requestedPeriod')"
}
],
"rule" : [
{
"name" : "appointment.requestedPeriod.start",
"source" : [
{
"context" : "itemp",
"element" : "item",
"variable" : "item2",
"condition" : "((linkId.value = 'appointment.requestedPeriod.start') and answer.exists())"
}
],
"target" : [
{
"context" : "appointment",
"contextType" : "variable",
"element" : "requestedPeriod",
"variable" : "requestedPeriod"
},
{
"context" : "requestedPeriod",
"contextType" : "variable",
"element" : "start",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item2.answer.value"
}
]
},
{
"context" : "requestedPeriod",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item2.answer.value"
}
]
}
],
"rule" : [
{
"name" : "appointment.requestedPeriod.end.if.not.same.as.start",
"source" : [
{
"context" : "itemp",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.requestedPeriod.end') and answer.exists())"
}
],
"target" : [
{
"context" : "requestedPeriod",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "pendingorbooked",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'appointment.status') and ((answer.value.code = 'pending') or (answer.value.code = 'booked')))"
}
],
"target" : [
{
"context" : "appointment",
"contextType" : "variable",
"element" : "status",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value.code"
}
]
}
],
"rule" : [
{
"name" : "appointment.startend",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "itemp",
"condition" : "(linkId.value = 'appointment.requestedPeriod')"
}
],
"rule" : [
{
"name" : "appointment.start",
"source" : [
{
"context" : "itemp",
"element" : "item",
"variable" : "item2",
"condition" : "((linkId.value = 'appointment.requestedPeriod.start') and answer.exists())"
}
],
"target" : [
{
"context" : "appointment",
"contextType" : "variable",
"element" : "start",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item2.answer.value"
}
]
},
{
"context" : "appointment",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item2.answer.value"
}
]
}
],
"rule" : [
{
"name" : "appointment.end.if.not.same.as.start",
"source" : [
{
"context" : "itemp",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.requestedPeriod.end') and answer.exists())"
}
],
"target" : [
{
"context" : "appointment",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "appointment.patientInstruction",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "((linkId.value = 'appointment.patientInstruction') and answer.exists())"
}
],
"target" : [
{
"context" : "appointment",
"contextType" : "variable",
"element" : "patientInstruction",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
},
{
"name" : "appointment.location",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "(linkId.value = 'appointment.location')"
}
],
"rule" : [
{
"name" : "location",
"source" : [
{
"context" : "item"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
},
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %uuid5"
}
]
},
{
"context" : "appointment",
"contextType" : "variable",
"element" : "participant",
"variable" : "participant"
},
{
"context" : "participant",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "tentative"
}
]
},
{
"context" : "participant",
"contextType" : "variable",
"element" : "actor",
"variable" : "actor",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "actor",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %location.id"
}
]
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.name') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
},
{
"name" : "appointment.location.phone",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.phone') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
},
{
"name" : "appointment.location.email",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.email') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "telecom",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "email"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
},
{
"name" : "appointment.location.streetAddressLine",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.streetAddressLine') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
}
],
"rule" : [
{
"name" : "line",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "address",
"contextType" : "variable",
"element" : "line",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "answer.value"
}
]
}
]
}
]
},
{
"name" : "appointment.location.postalCode",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.postalCode') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "postalCode",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
},
{
"name" : "appointment.location.city",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.city') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "city",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
},
{
"name" : "appointment.location.country",
"source" : [
{
"context" : "item",
"element" : "item",
"variable" : "item3",
"condition" : "((linkId.value = 'appointment.location.country') and answer.exists())"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "address",
"variable" : "address",
"listMode" : [
"share"
],
"listRuleId" : "orgAddress"
},
{
"context" : "address",
"contextType" : "variable",
"element" : "country",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item3.answer.value"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "PreviousResults",
"typeMode" : "none",
"input" : [
{
"name" : "grp",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "item",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "((linkId = 'previousResults.attachment') and answer.exists())"
}
],
"rule" : [
{
"name" : "answer",
"source" : [
{
"context" : "item",
"element" : "answer",
"variable" : "answer"
}
],
"rule" : [
{
"name" : "media",
"source" : [
{
"context" : "answer",
"type" : "Attachment",
"element" : "value",
"variable" : "attachment"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "media",
"transform" : "create",
"parameter" : [
{
"valueString" : "Media"
}
]
},
{
"context" : "media",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "media",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "media",
"contextType" : "variable",
"element" : "content",
"transform" : "copy",
"parameter" : [
{
"valueId" : "attachment"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "supportingInfo",
"variable" : "supportingInfo"
},
{
"context" : "supportingInfo",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + uuid"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Note",
"typeMode" : "none",
"input" : [
{
"name" : "grp",
"type" : "BackboneElement",
"mode" : "source"
},
{
"name" : "serviceRequest",
"type" : "ServiceRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "note.text",
"source" : [
{
"context" : "grp",
"element" : "item",
"variable" : "item",
"condition" : "((linkId = 'note.text') and answer.exists())"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
},
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "item.answer.value"
}
]
}
]
}
]
},
{
"name" : "QrToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "qr",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "q",
"type" : "Questionnaire",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "questionnaireresp",
"type" : "QuestionnaireResponseTarget",
"mode" : "target"
},
{
"name" : "servicerequest",
"type" : "ServiceRequest",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "id",
"transform" : "uuid"
}
]
},
{
"name" : "type",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "type",
"transform" : "copy",
"parameter" : [
{
"valueString" : "document"
}
]
}
]
},
{
"name" : "composition",
"source" : [
{
"context" : "qr"
}
],
"dependent" : [
{
"name" : "OrfComposition",
"variable" : [
"qr",
"q",
"composition",
"patient",
"questionnaireresp",
"servicerequest",
"bundle"
]
}
]
},
{
"name" : "qrgroups",
"source" : [
{
"context" : "qr"
}
],
"dependent" : [
{
"name" : "QrToGroups",
"variable" : [
"qr",
"patient",
"bundle",
"composition",
"servicerequest"
]
}
]
}
]
},
{
"name" : "OrfComposition",
"typeMode" : "none",
"input" : [
{
"name" : "qr",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "q",
"type" : "Questionnaire",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "questionnaireresp",
"type" : "QuestionnaireResponseTarget",
"mode" : "target"
},
{
"name" : "servicerequest",
"type" : "ServiceRequest",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "subject",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
}
]
},
{
"name" : "sections",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
},
{
"context" : "tgtSection",
"contextType" : "variable",
"element" : "title",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Order-Referral"
}
]
},
{
"context" : "tgtSection",
"contextType" : "variable",
"element" : "code",
"variable" : "code"
},
{
"context" : "code",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://loinc.org"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "93037-0"
}
]
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Portable medical order form"
}
]
},
{
"context" : "tgtSection",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %questionnaireresp.id"
}
]
},
{
"context" : "tgtSection",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %servicerequest.id"
}
]
},
{
"context" : "tgtSection",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %q.id"
}
]
}
]
},
{
"name" : "servicerequest",
"source" : [
{
"context" : "qr"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
},
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
},
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patient.id"
}
]
}
]
}
]
}
]
}
IG © 2020+ HL7 Switzerland. Package ch.fhir.ig.ch-orf#2.0.0-ballot based on FHIR 4.0.1. Generated 2023-06-29
Links: Table of Contents |
QA Report
| Propose a change