CH RAD-Order (R4)
2.0.0-ci-build - ci-build Switzerland flag

CH RAD-Order (R4), published by HL7 Switzerland. This guide is not an authorized publication; it is the continuous build for version 2.0.0-ci-build built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7ch/ch-rad-order/ and changes regularly. See the Directory of published versions

: RadOrderQrToBundle - JSON Representation

Draft as of 2024-04-16

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "RadOrderQrToBundle",
  "meta" : {
    "versionId" : "34",
    "lastUpdated" : "2022-01-28T17:06:31.413+00:00"
  },
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n         <pre>map &quot;http://fhir.ch/ig/ch-rad-order/StructureMap/RadOrderQrToBundle&quot; = &quot;RadOrderQrToBundle&quot;\n\n// Radiologoy QuestionnaireResponse to Bundle\n\nuses &quot;http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse&quot; alias QuestionnaireResponse as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/PractitionerRole&quot; alias PractitionerRole as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/ServiceRequest&quot; alias ServiceRequest as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/BackboneElement&quot; alias BackboneElement as target\n\nimports &quot;http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle&quot;\n\ngroup RadOrderQrToBundle(source qr : QuestionnaireResponse, target bundle : Bundle) {\n  qr -&gt;  bundle.identifier as documentIdentifier,  documentIdentifier.system = 'urn:ietf:rfc:3986',  uuid() as uuidDoc,  documentIdentifier.value = ('urn:uuid:' + uuidDoc) &quot;documentIdentifier&quot;;\n  qr as qrcp -&gt;  bundle.entry as e,  e.resource = create('Composition') as composition,  composition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  composition.title = 'Radiologieauftrag',  composition.type as type,  type.coding as coding,  coding.code = '2161000195103',  coding.system = 'urn:oid:2.16.756.5.30.1.127.3.4',  coding.display = 'Imaging order (record artifact)',  composition.category as category,  category.coding as coding,  coding.code = '721963009',  coding.system = 'http://snomed.info/sct',  coding.display = 'Order (record artifact)',  bundle.entry as e2,  bundle.timestamp = (now()) as timestamp,  composition.date = timestamp,  e2.resource = create('Patient') as patient,  patient.id = uuid() as uuid2,  e2.fullUrl = ('urn:uuid:' + uuid2),  bundle.entry as e4,  e4.resource = qrcp as questionnaireresp,  questionnaireresp.id = uuid() as uuid4,  e4.fullUrl = ('urn:uuid:' + uuid4),  bundle.entry as e5,  e5.resource = create('ServiceRequest') as servicerequest,  servicerequest.id = uuid() as uuid5,  e5.fullUrl = ('urn:uuid:' + uuid5) then {\n    qr.questionnaire as can -&gt;  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) &quot;orfbundle&quot;;\n    qr then RadOrderQrToServiceRequest(qr, patient, bundle, composition, servicerequest) &quot;servicerequest&quot;;\n  } &quot;orfbundle&quot;;\n}\n\ngroup RadOrderQrToServiceRequest(source qr : QuestionnaireResponse, target patient : Patient, target bundle : Bundle, target composition : Composition, target serviceRequest : ServiceRequest) {\n  qr.item as grp where linkId = 'requestedService' then RequestedServiceItems(grp, serviceRequest) &quot;requestedService&quot;;\n  qr.item as grp where linkId = 'reason' then ReasonServiceItems(grp, serviceRequest) &quot;reason&quot;;\n  qr.item as grp where linkId = 'imagingService' then ImagingServiceItems(grp, serviceRequest) &quot;imagingService&quot;;\n  qr.item as grp where linkId = 'orderDetail' then OrderDetailServiceItems(grp, serviceRequest) &quot;orderDetail&quot;;\n  qr.item as grp where linkId = 'desiredRadiologist' then DesiredRadiologistServiceItems(grp, bundle, serviceRequest) &quot;desiredRadiologist&quot;;\n  qr.item as grp where linkId = 'diagnosisList' then DiagnosisListServiceItems(grp, patient, bundle, serviceRequest) &quot;diagnosisList&quot;;\n  qr.item as grp where linkId = 'caveat' then CaveatServiceItems(grp, patient, bundle, serviceRequest) &quot;Caveat&quot;;\n  qr.item as grp where linkId = 'attachment' then PreviousImagingStudyResults(grp, bundle, serviceRequest, patient) &quot;attachment&quot;;\n}\n\ngroup RequestedServiceItems(source src : BackboneElement, target serviceRequest : ServiceRequest) {\n  src.item as item where ((linkId.value = 'requestedService.service') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.category as cc,  cc.coding = coding &quot;service&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n}\n\ngroup ReasonServiceItems(source src : BackboneElement, target serviceRequest : ServiceRequest) {\n  src.item as item where ((linkId.value = 'reason.question') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : string as value -&gt;  serviceRequest.reasonCode as reasonCode,  reasonCode.text = value &quot;question&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n}\n\ngroup ImagingServiceItems(source src : BackboneElement, target serviceRequest : ServiceRequest) {\n  src.item as item where ((linkId.value = 'imagingService.type') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.code as code,  code.coding = coding &quot;service&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n}\n\ngroup OrderDetailServiceItems(source src : BackboneElement, target serviceRequest : ServiceRequest) {\n  src.item as item where ((linkId.value = 'orderDetail.imagingRegion') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.orderDetail as cc,  cc.extension as ext,  ext.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type',  ext.value = create('Coding') as coding,  coding.system = 'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type',  coding.code = 'imagingRegion',  cc.coding = coding &quot;imagingRegion&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'orderDetail.imagingFocus') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.bodySite as cc,  cc.coding = coding &quot;imagingFocus&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'orderDetail.laterality') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.orderDetail as cc,  cc.extension as ext,  ext.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type',  ext.value = create('Coding') as coding,  coding.system = 'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type',  coding.code = 'laterality',  cc.coding = coding &quot;laterality&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'orderDetail.viewType') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.orderDetail as cc,  cc.extension as ext,  ext.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type',  ext.value = create('Coding') as coding,  coding.system = 'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type',  coding.code = 'viewType',  cc.coding = coding &quot;viewType&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'orderDetail.maneuverType') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.orderDetail as cc,  cc.extension as ext,  ext.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type',  ext.value = create('Coding') as coding,  coding.system = 'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type',  coding.code = 'maneuverType',  cc.coding = coding &quot;maneuverType&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'orderDetail.guidanceForAction') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as coding -&gt;  serviceRequest.orderDetail as cc,  cc.extension as ext,  ext.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type',  ext.value = create('Coding') as coding,  coding.system = 'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type',  coding.code = 'guidanceForAction',  cc.coding = coding &quot;guidanceForAction&quot;;\n    } &quot;valueCoding&quot;;\n  } &quot;answer&quot;;\n}\n\ngroup DesiredRadiologistServiceItems(source src : BackboneElement, target bundle : Bundle, target serviceRequest : ServiceRequest) {\n  src -&gt;  bundle.entry as e,  e.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid,  serviceRequest.performer as performer,  performer.reference = ('urn:uuid:' + uuid),  e.fullUrl = ('urn:uuid:' + uuid) then {\n    src.item as item where ((linkId.value = 'desiredRadiologist.familyName') and answer.exists()) -&gt;  practitioner.name as name share name,  name.family = (item.answer.value);\n    src.item as item where ((linkId.value = 'desiredRadiologist.givenName') and answer.exists()) -&gt;  practitioner.name as name share name,  name.given = (item.answer.value);\n  } &quot;performer&quot;;\n}\n\ngroup DiagnosisListServiceItems(source src : BackboneElement, target patient : Patient, target bundle : Bundle, target serviceRequest : ServiceRequest) {\n  src.item as item where ((linkId.value = 'diagnosisList.primaryDiagnosis') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : string as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.reasonReference as reasonReference,  reasonReference.reference = ('urn:uuid:' + uuid),  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.text = value,  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;primaryDiagnosis&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'diagnosisList.secondaryDiagnosis') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : string as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.text = value,  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;secondaryDiagnosis&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'diagnosisList.bodyHeight') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Quantity as value -&gt;  bundle.entry as e,  e.resource = create('Observation') as observation,  observation.status = 'final',  observation.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  observation.status = 'final',  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  observation.category as category,  category.coding as coding,  coding.code = 'vital-signs',  coding.system = 'http://terminology.hl7.org/CodeSystem/observation-category',  observation.value = value,  observation.code as cc,  cc.coding as c,  c.system = 'http://loinc.org',  c.code = '8302-2',  observation.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;bodyHeight&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'diagnosisList.bodyWeight') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Quantity as value -&gt;  bundle.entry as e,  e.resource = create('Observation') as observation,  observation.status = 'final',  observation.id = uuid() as uuid,  observation.status = 'final',  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  observation.category as category,  category.coding as coding,  coding.code = 'vital-signs',  coding.system = 'http://terminology.hl7.org/CodeSystem/observation-category',  observation.value = value,  observation.code as cc,  cc.coding as c,  c.system = 'http://loinc.org',  c.code = '29463-7',  observation.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;bodyWeight&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n}\n\ngroup CaveatServiceItems(source src : BackboneElement, target patient : Patient, target bundle : Bundle, target serviceRequest : ServiceRequest) {\n  src.item as item where ((linkId.value = 'caveat.bloodCoagulation') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '64779008',  coding.system = 'http://snomed.info/sct',  coding.display = 'Blood coagulation disorder (disorder)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '64779008',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Blood coagulation disorder (disorder)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) then {\n        answer.item as subitem where (linkId.value = 'caveat.bloodCoagulation.INR') -&gt;  bundle.entry as e,  e.resource = create('Observation') as observation,  observation.id = uuid() as uuid,  observation.status = 'final',  e.fullUrl = ('urn:uuid:' + uuid),  condition.evidence as evidence,  evidence.detail as detail,  detail.reference = ('urn:uuid:' + uuid),  observation.code as cc,  cc.coding as c,  c.system = 'http://loinc.org',  c.code = '34714-6',  observation.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) then {\n          subitem.item as quantityitem where ((linkId.value = 'caveat.bloodCoagulation.INR.quantity') and answer.exists()) then {\n            quantityitem.answer as answer then {\n              answer.value : Quantity as value -&gt; observation.value = value;\n            } &quot;value&quot;;\n          } &quot;quantity&quot;;\n          subitem.item as datetimeitem where ((linkId.value = 'caveat.bloodCoagulation.INR.dateTime') and answer.exists()) then {\n            datetimeitem.answer as answer then {\n              answer.value : dateTime as value -&gt; observation.effective = value;\n            } &quot;value&quot;;\n          } &quot;dateTime&quot;;\n        } &quot;INR&quot;;\n        answer.item as subitem where (linkId.value = 'caveat.bloodCoagulation.platelets') -&gt;  bundle.entry as e,  e.resource = create('Observation') as observation,  observation.id = uuid() as uuid,  observation.status = 'final',  e.fullUrl = ('urn:uuid:' + uuid),  condition.evidence as evidence,  evidence.detail as detail,  detail.reference = ('urn:uuid:' + uuid),  observation.code as cc,  cc.coding as c,  c.system = 'http://loinc.org',  c.code = '26515-7',  observation.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) then {\n          subitem.item as quantityitem where ((linkId.value = 'caveat.bloodCoagulation.platelets.quantity') and answer.exists()) then {\n            quantityitem.answer as answer then {\n              answer.value : Quantity as value -&gt; observation.value = value;\n            } &quot;value&quot;;\n          } &quot;platelets&quot;;\n          subitem.item as datetimeitem where ((linkId.value = 'caveat.bloodCoagulation.platelets.dateTime') and answer.exists()) then {\n            datetimeitem.answer as answer then {\n              answer.value : dateTime as value -&gt; observation.effective = value;\n            } &quot;value&quot;;\n          } &quot;platelets&quot;;\n        } &quot;INR&quot;;\n      } &quot;bloodCoagulation&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'caveat.renalInsufficiency') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '723188008',  coding.system = 'http://snomed.info/sct',  coding.display = 'Renal insufficiency (disorder)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '723188008',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Renal insufficiency (disorder)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) then {\n        answer.item as subitem where (linkId.value = 'caveat.renalInsufficiency.creatinineClearance') -&gt;  bundle.entry as e,  e.resource = create('Observation') as observation,  observation.status = 'final',  observation.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  condition.evidence as evidence,  evidence.detail as detail,  detail.reference = ('urn:uuid:' + uuid),  observation.code as cc,  cc.coding as c,  c.system = 'http://loinc.org',  c.code = '33558-8',  observation.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) then {\n          subitem.item as quantityitem where ((linkId.value = 'caveat.renalInsufficiency.creatinineClearance.quantity') and answer.exists()) then {\n            quantityitem.answer as answer then {\n              answer.value : Quantity as value -&gt; observation.value = value;\n            } &quot;value&quot;;\n          } &quot;quantity&quot;;\n          subitem.item as datetimeitem where ((linkId.value = 'caveat.renalInsufficiency.creatinineClearance.dateTime') and answer.exists()) then {\n            datetimeitem.answer as answer then {\n              answer.value : dateTime as value -&gt; observation.effective = value;\n            } &quot;value&quot;;\n          } &quot;creatinineClearancedateTime&quot;;\n        } &quot;INR&quot;;\n        answer.item as subitem where (linkId.value = 'caveat.renalInsufficiency.creatinine') -&gt;  bundle.entry as e,  e.resource = create('Observation') as observation,  observation.status = 'final',  observation.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  condition.evidence as evidence,  evidence.detail as detail,  detail.reference = ('urn:uuid:' + uuid),  observation.code as cc,  cc.coding as c,  c.system = 'http://loinc.org',  c.code = '77140-2',  observation.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) then {\n          subitem.item as quantityitem where ((linkId.value = 'caveat.renalInsufficiency.creatinine.quantity') and answer.exists()) then {\n            quantityitem.answer as answer then {\n              answer.value : Quantity as value -&gt; observation.value = value;\n            } &quot;value&quot;;\n          } &quot;creatinine&quot;;\n          subitem.item as datetimeitem where ((linkId.value = 'caveat.renalInsufficiency.creatinine.dateTime') and answer.exists()) then {\n            datetimeitem.answer as answer then {\n              answer.value : dateTime as value -&gt; observation.effective = value;\n            } &quot;ue&quot;;\n          } &quot;platelets&quot;;\n        } &quot;creatinine&quot;;\n      } &quot;bloodCoagulation&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'caveat.claustrophobia') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '19887002',  coding.system = 'http://snomed.info/sct',  coding.display = 'Claustrophobia (finding)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '19887002',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Claustrophobia (finding)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;claustrophobia&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'caveat.bodyPiercing') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '879862001',  coding.system = 'http://snomed.info/sct',  coding.display = 'Body piercing (finding)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '879862001',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Body piercing (finding)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;bodyPiercing&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where (linkId.value = 'caveat.device') -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid) then {\n    item.item as subitem where ((linkId.value = 'caveat.device.choice') and answer.exists()) then {\n      subitem.answer as answer then {\n        answer.value : Coding as value -&gt;  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '397578001',  coding.system = 'http://snomed.info/sct',  coding.display = 'Device in situ (finding)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;device&quot;;\n      } &quot;choise&quot;;\n      item.item as subitem where ((linkId.value = 'caveat.device.specifictype') and answer.exists()) then {\n        subitem.answer as answer then {\n          answer.value : Coding as value -&gt;  condition.code as code,  code.coding = value &quot;devicespecific&quot;;\n        } &quot;specifictype&quot;;\n      } &quot;devicespecific&quot;;\n    } &quot;device&quot;;\n  } &quot;device&quot;;\n  src.item as item where ((linkId.value = 'caveat.hyperthyroidism') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '34486009',  coding.system = 'http://snomed.info/sct',  coding.display = 'Hyperthyroidism (disorder)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '34486009',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Hyperthyroidism (disorder)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;hyperthyroidism&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'caveat.diabetes') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '73211009',  coding.system = 'http://snomed.info/sct',  coding.display = 'Diabetes mellitus (disorder)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '73211009',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Diabetes mellitus (disorder)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;diabetes&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'caveat.gravida') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '366321006',  coding.system = 'http://snomed.info/sct',  coding.display = 'Finding of gravida (finding)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '366321006',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Finding of gravida (finding)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;gravida&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  src.item as item where ((linkId.value = 'caveat.contrastMediaAllergy') and answer.exists()) then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '293637006',  coding.system = 'http://snomed.info/sct',  coding.display = 'Allergy to contrast media (finding)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '293637006',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Allergy to contrast media (finding)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;contrastMediaAllergy&quot;;\n    } &quot;valueString&quot;;\n  } &quot;answer&quot;;\n  // &quot;caveat.drugPrescription.metformin&quot;\n  src.item as item where (linkId.value = 'caveat.drugPrescription') then DesiredRadiologistServiceItemsDrugDescription(item, bundle, serviceRequest, patient) &quot;DrugPrescription&quot;;\n}\n\ngroup DesiredRadiologistServiceItemsDrugDescription(source src : BackboneElement, target bundle : Bundle, target serviceRequest : ServiceRequest, target patient : Patient) {\n  src.item as item where (linkId.value = 'caveat.drugPrescription.metformin') then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '182817000',  coding.system = 'http://snomed.info/sct',  coding.display = 'Drug prescription (situation)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '372567009',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Metformin (substance)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;drugPrescription&quot;;\n    } &quot;valueString&quot;;\n  } &quot;metformin&quot;;\n  src.item as item where (linkId.value = 'caveat.drugPrescription.betaBlocker') then {\n    item.answer as answer then {\n      answer.value : Coding as value -&gt;  bundle.entry as e,  e.resource = create('Condition') as condition,  condition.id = uuid() as uuid,  e.fullUrl = ('urn:uuid:' + uuid),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid),  condition.extension as ext1,  ext1.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type',  ext1.value = create('Coding') as coding,  coding.code = '182817000',  coding.system = 'http://snomed.info/sct',  coding.display = 'Drug prescription (situation)',  condition.extension as ext2,  ext2.url = 'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value',  ext2.value = value,  condition.category as category,  category.coding as coding,  coding.code = 'problem-list-item',  coding.system = 'http://terminology.hl7.org/CodeSystem/condition-category',  coding.display = 'Problem List Item',  condition.code as code,  code.coding as coding2,  coding2.code = '373254001',  coding2.system = 'http://snomed.info/sct',  coding2.display = 'Substance with beta adrenergic receptor antagonist mechanism of action (substance)',  condition.subject as subject,  subject.reference = ('urn:uuid:' + patient.id) &quot;drugPrescription&quot;;\n    } &quot;valueString&quot;;\n  } &quot;betaBlocker&quot;;\n}\n\ngroup PreviousImagingStudyResults(source grp : BackboneElement, target bundle : Bundle, target serviceRequest : ServiceRequest, target patient : Patient) {\n  grp.item as item where (linkId.value = 'attachment.imagingStudy') -&gt;  bundle.entry as e,  e.resource = create('ImagingStudy') as imagingStudy,  imagingStudy.id = uuid() as uuid,  imagingStudy.status = 'available',  imagingStudy.subject as subject,  subject.reference = ('urn:uuid:' + patient.id),  e.fullUrl = append('urn:uuid:', uuid),  serviceRequest.subject as subject,  subject.reference = ('urn:uuid:' + patient.id),  serviceRequest.supportingInfo as supportingInfo,  supportingInfo.reference = ('urn:uuid:' + uuid) then {\n    item.item as dictomitem where ((linkId.value = 'attachment.imagingStudy.StudyInstanceUid') and answer.exists()) -&gt;  imagingStudy.identifier as uid,  uid.system = 'urn:dicom:uid',  uid.use = 'official',  uid.value = ('urn:oid:' + dictomitem.answer.value) &quot;uid&quot;;\n    item.item as dictomitem where ((linkId.value = 'attachment.imagingStudy.acsn') and answer.exists()) -&gt;  imagingStudy.identifier as acsn,  acsn.type as type,  type.coding as coding,  coding.system = 'http://terminology.hl7.org/CodeSystem/v2-0203',  coding.code = 'ACSN',  acsn.use = 'usual',  acsn.value = (dictomitem.answer.value) &quot;acsn&quot;;\n    item.item as dictomitem where ((linkId.value = 'attachment.imagingStudy.SeriesInstanceUid') and answer.exists()) -&gt; imagingStudy.series as series then {\n      dictomitem.answer as answer then {\n        answer.value : string as value -&gt; series.uid = value &quot;uid&quot;;\n        item.item as dictomitem where ((linkId.value = 'attachment.imagingStudy.SopInstanceUid') and answer.exists()) -&gt; series.instance as instance then {\n          dictomitem.answer as answer then {\n            answer.value : string as value -&gt; instance.uid = value &quot;uid&quot;;\n          };\n        } &quot;answer&quot;;\n      } &quot;series&quot;;\n    } &quot;imagingStudy&quot;;\n  } &quot;previousResult&quot;;\n}\n\n</pre>\n      </div>"
  },
  "url" : "http://fhir.ch/ig/ch-rad-order/StructureMap/RadOrderQrToBundle",
  "version" : "2.0.0-ci-build",
  "name" : "RadOrderQrToBundle",
  "status" : "draft",
  "date" : "2024-04-16T11:59:58+00:00",
  "publisher" : "HL7 Switzerland",
  "contact" : [
    {
      "name" : "Juerg P. Bleuer",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://www.hl7.ch"
        }
      ]
    }
  ],
  "description" : "Radiologoy QuestionnaireResponse to Bundle",
  "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/Bundle",
      "mode" : "target",
      "alias" : "Bundle"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode" : "target",
      "alias" : "Patient"
    },
    {
      "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/BackboneElement",
      "mode" : "target",
      "alias" : "BackboneElement"
    }
  ],
  "import" : [
    🔗 "http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle"
  ],
  "group" : [
    {
      "name" : "RadOrderQrToBundle",
      "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" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + 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" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + uuid"
                }
              ]
            },
            {
              "context" : "composition",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Radiologieauftrag"
                }
              ]
            },
            {
              "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" : "2161000195103"
                }
              ]
            },
            {
              "context" : "coding",
              "contextType" : "variable",
              "element" : "system",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "urn:oid:2.16.756.5.30.1.127.3.4"
                }
              ]
            },
            {
              "context" : "coding",
              "contextType" : "variable",
              "element" : "display",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Imaging order (record artifact)"
                }
              ]
            },
            {
              "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" : "coding",
              "contextType" : "variable",
              "element" : "display",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Order (record artifact)"
                }
              ]
            },
            {
              "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" : "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" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + 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" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + 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" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + 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" : "servicerequest",
              "source" : [
                {
                  "context" : "qr"
                }
              ],
              "dependent" : [
                {
                  "name" : "RadOrderQrToServiceRequest",
                  "variable" : [
                    "qr",
                    "patient",
                    "bundle",
                    "composition",
                    "servicerequest"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "RadOrderQrToServiceRequest",
      "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" : "requestedService",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'requestedService'"
            }
          ],
          "dependent" : [
            {
              "name" : "RequestedServiceItems",
              "variable" : [
                "grp",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "reason",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'reason'"
            }
          ],
          "dependent" : [
            {
              "name" : "ReasonServiceItems",
              "variable" : [
                "grp",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "imagingService",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'imagingService'"
            }
          ],
          "dependent" : [
            {
              "name" : "ImagingServiceItems",
              "variable" : [
                "grp",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "orderDetail",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'orderDetail'"
            }
          ],
          "dependent" : [
            {
              "name" : "OrderDetailServiceItems",
              "variable" : [
                "grp",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "desiredRadiologist",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'desiredRadiologist'"
            }
          ],
          "dependent" : [
            {
              "name" : "DesiredRadiologistServiceItems",
              "variable" : [
                "grp",
                "bundle",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "diagnosisList",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'diagnosisList'"
            }
          ],
          "dependent" : [
            {
              "name" : "DiagnosisListServiceItems",
              "variable" : [
                "grp",
                "patient",
                "bundle",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "Caveat",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'caveat'"
            }
          ],
          "dependent" : [
            {
              "name" : "CaveatServiceItems",
              "variable" : [
                "grp",
                "patient",
                "bundle",
                "serviceRequest"
              ]
            }
          ]
        },
        {
          "name" : "attachment",
          "source" : [
            {
              "context" : "qr",
              "element" : "item",
              "variable" : "grp",
              "condition" : "linkId = 'attachment'"
            }
          ],
          "dependent" : [
            {
              "name" : "PreviousImagingStudyResults",
              "variable" : [
                "grp",
                "bundle",
                "serviceRequest",
                "patient"
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "RequestedServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'requestedService.service') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "requestedService.service",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ReasonServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'reason.question') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "reason.question",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "string",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "reasonCode",
                      "variable" : "reasonCode"
                    },
                    {
                      "context" : "reasonCode",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ImagingServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'imagingService.type') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "requestedService.service",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "OrderDetailServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'orderDetail.imagingRegion') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "orderDetail.imagingRegion",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "orderDetail",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext"
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "imagingRegion"
                        }
                      ]
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'orderDetail.imagingFocus') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "orderDetail.imagingFocus",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "bodySite",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'orderDetail.laterality') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "orderDetail.laterality",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "orderDetail",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext"
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "laterality"
                        }
                      ]
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'orderDetail.viewType') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "orderDetail.viewType",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "orderDetail",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext"
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "viewType"
                        }
                      ]
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'orderDetail.maneuverType') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "orderDetail.maneuverType",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "orderDetail",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext"
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "maneuverType"
                        }
                      ]
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'orderDetail.guidanceForAction') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueCoding",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "orderDetail.guidanceForAction",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "orderDetail",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext"
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "guidanceForAction"
                        }
                      ]
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "DesiredRadiologistServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "serviceRequest.performer",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "practitioner",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Practitioner"
                }
              ]
            },
            {
              "context" : "practitioner",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid",
              "transform" : "uuid"
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "performer",
              "variable" : "performer"
            },
            {
              "context" : "performer",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + uuid"
                }
              ]
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + uuid"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "item",
              "source" : [
                {
                  "context" : "src",
                  "element" : "item",
                  "variable" : "item",
                  "condition" : "((linkId.value = 'desiredRadiologist.familyName') and answer.exists())"
                }
              ],
              "target" : [
                {
                  "context" : "practitioner",
                  "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 = 'desiredRadiologist.givenName') and answer.exists())"
                }
              ],
              "target" : [
                {
                  "context" : "practitioner",
                  "contextType" : "variable",
                  "element" : "name",
                  "variable" : "name",
                  "listMode" : [
                    "share"
                  ],
                  "listRuleId" : "name"
                },
                {
                  "context" : "name",
                  "contextType" : "variable",
                  "element" : "given",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "item.answer.value"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "DiagnosisListServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'diagnosisList.primaryDiagnosis') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "diagnosisList.primaryDiagnosis",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "string",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "reasonReference",
                      "variable" : "reasonReference"
                    },
                    {
                      "context" : "reasonReference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'diagnosisList.secondaryDiagnosis') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "diagnosisList.secondaryDiagnosis",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "string",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'diagnosisList.bodyHeight') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "observation.bodyHeight",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Quantity",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "observation",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "vital-signs"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "c"
                    },
                    {
                      "context" : "c",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://loinc.org"
                        }
                      ]
                    },
                    {
                      "context" : "c",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "8302-2"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'diagnosisList.bodyWeight') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "observation.bodyWeight",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Quantity",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "observation",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "vital-signs"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "cc"
                    },
                    {
                      "context" : "cc",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "c"
                    },
                    {
                      "context" : "c",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://loinc.org"
                        }
                      ]
                    },
                    {
                      "context" : "c",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "29463-7"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "CaveatServiceItems",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.bloodCoagulation') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "bloodCoagulation",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "64779008"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Blood coagulation disorder (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "64779008"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Blood coagulation disorder (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "cavveat.bloodCoagulation.INR",
                      "source" : [
                        {
                          "context" : "answer",
                          "element" : "item",
                          "variable" : "subitem",
                          "condition" : "(linkId.value = 'caveat.bloodCoagulation.INR')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e"
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "observation",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Observation"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "evidence",
                          "variable" : "evidence"
                        },
                        {
                          "context" : "evidence",
                          "contextType" : "variable",
                          "element" : "detail",
                          "variable" : "detail"
                        },
                        {
                          "context" : "detail",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "cc"
                        },
                        {
                          "context" : "cc",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "c"
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://loinc.org"
                            }
                          ]
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "34714-6"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "subject"
                        },
                        {
                          "context" : "subject",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + patient.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "cavveat.bloodCoagulation.INR.quantity",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "quantityitem",
                              "condition" : "((linkId.value = 'caveat.bloodCoagulation.INR.quantity') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "cavveat.bloodCoagulation.INR.quantity.value",
                              "source" : [
                                {
                                  "context" : "quantityitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "Quantity",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "cavveat.bloodCoagulation.INR.dateTime",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "datetimeitem",
                              "condition" : "((linkId.value = 'caveat.bloodCoagulation.INR.dateTime') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "cavveat.bloodCoagulation.INR.dateTime.value",
                              "source" : [
                                {
                                  "context" : "datetimeitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "dateTime",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "effective",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "cavveat.bloodCoagulation.INR",
                      "source" : [
                        {
                          "context" : "answer",
                          "element" : "item",
                          "variable" : "subitem",
                          "condition" : "(linkId.value = 'caveat.bloodCoagulation.platelets')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e"
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "observation",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Observation"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "evidence",
                          "variable" : "evidence"
                        },
                        {
                          "context" : "evidence",
                          "contextType" : "variable",
                          "element" : "detail",
                          "variable" : "detail"
                        },
                        {
                          "context" : "detail",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "cc"
                        },
                        {
                          "context" : "cc",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "c"
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://loinc.org"
                            }
                          ]
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "26515-7"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "subject"
                        },
                        {
                          "context" : "subject",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + patient.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "cavveat.bloodCoagulation.INR.platelets",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "quantityitem",
                              "condition" : "((linkId.value = 'caveat.bloodCoagulation.platelets.quantity') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "cavveat.bloodCoagulation.INR.platelets.value",
                              "source" : [
                                {
                                  "context" : "quantityitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "Quantity",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "cavveat.bloodCoagulation.INR.platelets",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "datetimeitem",
                              "condition" : "((linkId.value = 'caveat.bloodCoagulation.platelets.dateTime') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "cavveat.bloodCoagulation.INR.platelets.value",
                              "source" : [
                                {
                                  "context" : "datetimeitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "dateTime",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "effective",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.renalInsufficiency') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "bloodCoagulation",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "723188008"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Renal insufficiency (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "723188008"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Renal insufficiency (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "caveat.renalInsufficiency.creatinineClearance.INR",
                      "source" : [
                        {
                          "context" : "answer",
                          "element" : "item",
                          "variable" : "subitem",
                          "condition" : "(linkId.value = 'caveat.renalInsufficiency.creatinineClearance')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e"
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "observation",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Observation"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "evidence",
                          "variable" : "evidence"
                        },
                        {
                          "context" : "evidence",
                          "contextType" : "variable",
                          "element" : "detail",
                          "variable" : "detail"
                        },
                        {
                          "context" : "detail",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "cc"
                        },
                        {
                          "context" : "cc",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "c"
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://loinc.org"
                            }
                          ]
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "33558-8"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "subject"
                        },
                        {
                          "context" : "subject",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + patient.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "caveat.renalInsufficiency.creatinineClearance.quantity",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "quantityitem",
                              "condition" : "((linkId.value = 'caveat.renalInsufficiency.creatinineClearance.quantity') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "caveat.renalInsufficiency.creatinineClearance.quantity.value",
                              "source" : [
                                {
                                  "context" : "quantityitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "Quantity",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "caveat.renalInsuffic.iency.creatinineClearancedateTime",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "datetimeitem",
                              "condition" : "((linkId.value = 'caveat.renalInsufficiency.creatinineClearance.dateTime') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "caveat.renalInsufficiency.creatinineClearance.dateTime.value",
                              "source" : [
                                {
                                  "context" : "datetimeitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "dateTime",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "effective",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "caveat.renalInsufficiency.creatinine",
                      "source" : [
                        {
                          "context" : "answer",
                          "element" : "item",
                          "variable" : "subitem",
                          "condition" : "(linkId.value = 'caveat.renalInsufficiency.creatinine')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e"
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "observation",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Observation"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "evidence",
                          "variable" : "evidence"
                        },
                        {
                          "context" : "evidence",
                          "contextType" : "variable",
                          "element" : "detail",
                          "variable" : "detail"
                        },
                        {
                          "context" : "detail",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + uuid"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "cc"
                        },
                        {
                          "context" : "cc",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "c"
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://loinc.org"
                            }
                          ]
                        },
                        {
                          "context" : "c",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "77140-2"
                            }
                          ]
                        },
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "subject"
                        },
                        {
                          "context" : "subject",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + patient.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "caveat.renalInsufficiency.creatinine",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "quantityitem",
                              "condition" : "((linkId.value = 'caveat.renalInsufficiency.creatinine.quantity') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "caveat.renalInsufficiency.creatinine.value",
                              "source" : [
                                {
                                  "context" : "quantityitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "Quantity",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "cavveat.bloodCoagulation.INR.platelets",
                          "source" : [
                            {
                              "context" : "subitem",
                              "element" : "item",
                              "variable" : "datetimeitem",
                              "condition" : "((linkId.value = 'caveat.renalInsufficiency.creatinine.dateTime') and answer.exists())"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "caveat.renalInsufficiency.creatinineval.ue",
                              "source" : [
                                {
                                  "context" : "datetimeitem",
                                  "element" : "answer",
                                  "variable" : "answer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "answer",
                                      "type" : "dateTime",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "effective",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.claustrophobia') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.claustrophobia",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "19887002"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Claustrophobia (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "19887002"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Claustrophobia (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.bodyPiercing') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.bodyPiercing",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "879862001"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Body piercing (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "879862001"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Body piercing (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "caveat.device",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "(linkId.value = 'caveat.device')"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "condition",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Condition"
                }
              ]
            },
            {
              "context" : "condition",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid",
              "transform" : "uuid"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + uuid"
                }
              ]
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "supportingInfo",
              "variable" : "supportingInfo"
            },
            {
              "context" : "supportingInfo",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + uuid"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "caveat.device",
              "source" : [
                {
                  "context" : "item",
                  "element" : "item",
                  "variable" : "subitem",
                  "condition" : "((linkId.value = 'caveat.device.choice') and answer.exists())"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.device.choice",
                  "source" : [
                    {
                      "context" : "subitem",
                      "element" : "answer",
                      "variable" : "answer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "caveat.device",
                      "source" : [
                        {
                          "context" : "answer",
                          "type" : "Coding",
                          "element" : "value",
                          "variable" : "value"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "extension",
                          "variable" : "ext1"
                        },
                        {
                          "context" : "ext1",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                            }
                          ]
                        },
                        {
                          "context" : "ext1",
                          "contextType" : "variable",
                          "element" : "value",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        },
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "397578001"
                            }
                          ]
                        },
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://snomed.info/sct"
                            }
                          ]
                        },
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "Device in situ (finding)"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "extension",
                          "variable" : "ext2"
                        },
                        {
                          "context" : "ext2",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                            }
                          ]
                        },
                        {
                          "context" : "ext2",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "value"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "category",
                          "variable" : "category"
                        },
                        {
                          "context" : "category",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding"
                        },
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "problem-list-item"
                            }
                          ]
                        },
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                            }
                          ]
                        },
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "Problem List Item"
                            }
                          ]
                        },
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "subject"
                        },
                        {
                          "context" : "subject",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'urn:uuid:' + patient.id"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "caveat.devicespecific",
                  "source" : [
                    {
                      "context" : "item",
                      "element" : "item",
                      "variable" : "subitem",
                      "condition" : "((linkId.value = 'caveat.device.specifictype') and answer.exists())"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "caveat.device.specifictype",
                      "source" : [
                        {
                          "context" : "subitem",
                          "element" : "answer",
                          "variable" : "answer"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "caveat.devicespecific",
                          "source" : [
                            {
                              "context" : "answer",
                              "type" : "Coding",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "condition",
                              "contextType" : "variable",
                              "element" : "code",
                              "variable" : "code"
                            },
                            {
                              "context" : "code",
                              "contextType" : "variable",
                              "element" : "coding",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "value"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.hyperthyroidism') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.hyperthyroidism",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "34486009"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Hyperthyroidism (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "34486009"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Hyperthyroidism (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.diabetes') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.diabetes",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "73211009"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Diabetes mellitus (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "73211009"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Diabetes mellitus (disorder)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.gravida') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.gravida",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "366321006"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Finding of gravida (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "366321006"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Finding of gravida (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item.answer",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "((linkId.value = 'caveat.contrastMediaAllergy') and answer.exists())"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.contrastMediaAllergy",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "293637006"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Allergy to contrast media (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "293637006"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Allergy to contrast media (finding)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "DrugPrescription",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "(linkId.value = 'caveat.drugPrescription')"
            }
          ],
          "dependent" : [
            {
              "name" : "DesiredRadiologistServiceItemsDrugDescription",
              "variable" : [
                "item",
                "bundle",
                "serviceRequest",
                "patient"
              ]
            }
          ],
          "documentation" : "\"caveat.drugPrescription.metformin\""
        }
      ]
    },
    {
      "name" : "DesiredRadiologistServiceItemsDrugDescription",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "caveat.drugPrescription.metformin",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "(linkId.value = 'caveat.drugPrescription.metformin')"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.drugPrescription",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "182817000"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Drug prescription (situation)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "372567009"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Metformin (substance)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "caveat.drugPrescription.betaBlocker",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "(linkId.value = 'caveat.drugPrescription.betaBlocker')"
            }
          ],
          "rule" : [
            {
              "name" : "answer.valueString",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "variable" : "answer"
                }
              ],
              "rule" : [
                {
                  "name" : "caveat.drugPrescription",
                  "source" : [
                    {
                      "context" : "answer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "condition",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Condition"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "supportingInfo",
                      "variable" : "supportingInfo"
                    },
                    {
                      "context" : "supportingInfo",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + uuid"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext1"
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"
                        }
                      ]
                    },
                    {
                      "context" : "ext1",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "182817000"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Drug prescription (situation)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "ext2"
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"
                        }
                      ]
                    },
                    {
                      "context" : "ext2",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "category",
                      "variable" : "category"
                    },
                    {
                      "context" : "category",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "problem-list-item"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-category"
                        }
                      ]
                    },
                    {
                      "context" : "coding",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Problem List Item"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "code"
                    },
                    {
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding2"
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "373254001"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "http://snomed.info/sct"
                        }
                      ]
                    },
                    {
                      "context" : "coding2",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Substance with beta adrenergic receptor antagonist mechanism of action (substance)"
                        }
                      ]
                    },
                    {
                      "context" : "condition",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "subject"
                    },
                    {
                      "context" : "subject",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'urn:uuid:' + patient.id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "PreviousImagingStudyResults",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "grp",
          "type" : "BackboneElement",
          "mode" : "source"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "serviceRequest",
          "type" : "ServiceRequest",
          "mode" : "target"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "previousResult",
          "source" : [
            {
              "context" : "grp",
              "element" : "item",
              "variable" : "item",
              "condition" : "(linkId.value = 'attachment.imagingStudy')"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "imagingStudy",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "ImagingStudy"
                }
              ]
            },
            {
              "context" : "imagingStudy",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid",
              "transform" : "uuid"
            },
            {
              "context" : "imagingStudy",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "available"
                }
              ]
            },
            {
              "context" : "imagingStudy",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "subject"
            },
            {
              "context" : "subject",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + patient.id"
                }
              ]
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "urn:uuid:"
                },
                {
                  "valueId" : "uuid"
                }
              ]
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "subject"
            },
            {
              "context" : "subject",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + patient.id"
                }
              ]
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "supportingInfo",
              "variable" : "supportingInfo"
            },
            {
              "context" : "supportingInfo",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'urn:uuid:' + uuid"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "uid",
              "source" : [
                {
                  "context" : "item",
                  "element" : "item",
                  "variable" : "dictomitem",
                  "condition" : "((linkId.value = 'attachment.imagingStudy.StudyInstanceUid') and answer.exists())"
                }
              ],
              "target" : [
                {
                  "context" : "imagingStudy",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "uid"
                },
                {
                  "context" : "uid",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "urn:dicom:uid"
                    }
                  ]
                },
                {
                  "context" : "uid",
                  "contextType" : "variable",
                  "element" : "use",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "official"
                    }
                  ]
                },
                {
                  "context" : "uid",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'urn:oid:' + dictomitem.answer.value"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "acsn",
              "source" : [
                {
                  "context" : "item",
                  "element" : "item",
                  "variable" : "dictomitem",
                  "condition" : "((linkId.value = 'attachment.imagingStudy.acsn') and answer.exists())"
                }
              ],
              "target" : [
                {
                  "context" : "imagingStudy",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "acsn"
                },
                {
                  "context" : "acsn",
                  "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" : "ACSN"
                    }
                  ]
                },
                {
                  "context" : "acsn",
                  "contextType" : "variable",
                  "element" : "use",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "usual"
                    }
                  ]
                },
                {
                  "context" : "acsn",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "dictomitem.answer.value"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "imagingStudy",
              "source" : [
                {
                  "context" : "item",
                  "element" : "item",
                  "variable" : "dictomitem",
                  "condition" : "((linkId.value = 'attachment.imagingStudy.SeriesInstanceUid') and answer.exists())"
                }
              ],
              "target" : [
                {
                  "context" : "imagingStudy",
                  "contextType" : "variable",
                  "element" : "series",
                  "variable" : "series"
                }
              ],
              "rule" : [
                {
                  "name" : "series",
                  "source" : [
                    {
                      "context" : "dictomitem",
                      "element" : "answer",
                      "variable" : "answer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "uid",
                      "source" : [
                        {
                          "context" : "answer",
                          "type" : "string",
                          "element" : "value",
                          "variable" : "value"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "series",
                          "contextType" : "variable",
                          "element" : "uid",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "value"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "answer",
                      "source" : [
                        {
                          "context" : "item",
                          "element" : "item",
                          "variable" : "dictomitem",
                          "condition" : "((linkId.value = 'attachment.imagingStudy.SopInstanceUid') and answer.exists())"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "series",
                          "contextType" : "variable",
                          "element" : "instance",
                          "variable" : "instance"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "answer",
                          "source" : [
                            {
                              "context" : "dictomitem",
                              "element" : "answer",
                              "variable" : "answer"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "uid",
                              "source" : [
                                {
                                  "context" : "answer",
                                  "type" : "string",
                                  "element" : "value",
                                  "variable" : "value"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "instance",
                                  "contextType" : "variable",
                                  "element" : "uid",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "value"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}