CH RAD-Order (R4)
2.0.0-ballot - ballot
This page is part of the CH RAD-Order (R4) (v2.0.0-ballot: STU 2 Ballot 1) based on FHIR (HL7® FHIR® Standard) R4. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions
Draft as of 2024-05-17 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="RadOrderQrToBundle"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><pre class="fml">
<b>map</b><span style="color: navy"> "</span>http://fhir.ch/ig/ch-rad-order/StructureMap/RadOrderQrToBundle<span style="color: navy">" = "</span>RadOrderQrToBundle<span style="color: navy">"
</span><span style="color: navy">// </span><span style="color: green">Radiologoy QuestionnaireResponse to Bundle</span>
<span style="color: navy">// </span><span style="color: green">Derived from ORF QuestionnaireResponse to Bundle</span>
<span style="color: navy">// </span><span style="color: green">2021-01-11 Oliver Egger, copyright ahdis ag, Apache License</span>
<span style="color: navy">// </span><span style="color: green">QRF Questionnaire: http://fhir.ch/ig/ch-orf/Questionnaire-order-referral-form.html</span>
<span style="color: navy">// </span><span style="color: green">QRF QuestionnaireResponse: http://fhir.ch/ig/ch-orf/QuestionnaireResponse-order-referral-form.xml.html</span>
<span style="color: navy">// </span><span style="color: green">Bundle: http://fhir.ch/ig/ch-orf/StructureDefinition-ch-orf-document.html</span>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/questionnaireresponse.html" title="QuestionnaireResponse">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style="color: navy">" </span><b>alias </b>QuestionnaireResponse <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/bundle.html" title="Bundle">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style="color: navy">" </span><b>alias </b>Bundle <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/composition.html" title="Composition">http://hl7.org/fhir/StructureDefinition/Composition</a><span style="color: navy">" </span><b>alias </b>Composition <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/patient.html" title="Patient">http://hl7.org/fhir/StructureDefinition/Patient</a><span style="color: navy">" </span><b>alias </b>Patient <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/relatedperson.html" title="RelatedPerson">http://hl7.org/fhir/StructureDefinition/RelatedPerson</a><span style="color: navy">" </span><b>alias </b>RelatedPerson <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/organization.html" title="Organization">http://hl7.org/fhir/StructureDefinition/Organization</a><span style="color: navy">" </span><b>alias </b>Organization <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/practitioner.html" title="Practitioner">http://hl7.org/fhir/StructureDefinition/Practitioner</a><span style="color: navy">" </span><b>alias </b>Practitioner <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/practitionerrole.html" title="PractitionerRole">http://hl7.org/fhir/StructureDefinition/PractitionerRole</a><span style="color: navy">" </span><b>alias </b>PractitionerRole <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/servicerequest.html" title="ServiceRequest">http://hl7.org/fhir/StructureDefinition/ServiceRequest</a><span style="color: navy">" </span><b>alias </b>ServiceRequest <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/extensibility.html#Extension" title="Extension">http://hl7.org/fhir/StructureDefinition/Extension</a><span style="color: navy">" </span><b>alias </b>Extension <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/episodeofcare.html" title="EpisodeOfCare">http://hl7.org/fhir/StructureDefinition/EpisodeOfCare</a><span style="color: navy">" </span><b>alias </b>EpisodeOfCare <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/questionnaireresponse.html" title="QuestionnaireResponse">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style="color: navy">" </span><b>alias </b>QuestionnaireResponseTarget <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/questionnaireresponse.html" title="QuestionnaireResponse">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style="color: navy">" </span><b>alias </b>QuestionnaireResponse <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/bundle.html" title="Bundle">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style="color: navy">" </span><b>alias </b>Bundle <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/patient.html" title="Patient">http://hl7.org/fhir/StructureDefinition/Patient</a><span style="color: navy">" </span><b>alias </b>Patient <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/organization.html" title="Organization">http://hl7.org/fhir/StructureDefinition/Organization</a><span style="color: navy">" </span><b>alias </b>Organization <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/practitioner.html" title="Practitioner">http://hl7.org/fhir/StructureDefinition/Practitioner</a><span style="color: navy">" </span><b>alias </b>Practitioner <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/practitionerrole.html" title="PractitionerRole">http://hl7.org/fhir/StructureDefinition/PractitionerRole</a><span style="color: navy">" </span><b>alias </b>PractitionerRole <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/servicerequest.html" title="ServiceRequest">http://hl7.org/fhir/StructureDefinition/ServiceRequest</a><span style="color: navy">" </span><b>alias </b>ServiceRequest <b>as </b><b>target</b>
<b>imports</b><span style="color: navy"> "</span><a href="http://fhir.ch/ig/ch-orf/3.0.0-ballot/StructureMap-OrfQrToBundle.html" title="OrfQrToBundle">http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle</a><span style="color: navy">"
</span>
<b>group </b>RadOrderQrToBundle<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle<span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> bundle.identifier<b> as </b><span style="color: maroon">documentIdentifier</span><span style="color: navy">, </span> documentIdentifier.system = <span style="color: blue">'urn:ietf:rfc:3986'</span><span style="color: navy">, </span> <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuidDoc</span><span style="color: navy">, </span> documentIdentifier.value = <b>append</b><span style="color: navy">(</span><span style="color: blue">'urn:uuid:'</span><span style="color: navy">, </span><span style="color: maroon">uuidDoc</span><span style="color: navy">)</span> <i>"documentIdentifier"</i><span style="color: navy">;</span>
qr<b> as </b><span style="color: maroon">qrcp</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Composition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">composition</span><span style="color: navy">, </span> composition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> composition.title = <span style="color: blue">'Radiologieauftrag'</span><span style="color: navy">, </span> composition.type<b> as </b><span style="color: maroon">type</span><span style="color: navy">, </span> type.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'2161000195103'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'urn:oid:2.16.756.5.30.1.127.3.4'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Imaging order (record artifact)'</span><span style="color: navy">, </span> composition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'721963009'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Order (record artifact)'</span><span style="color: navy">, </span> bundle.entry<b> as </b><span style="color: maroon">e2</span><span style="color: navy">, </span> bundle.timestamp = <span style="color: navy">(</span>now()<span style="color: navy">)</span><b> as </b><span style="color: maroon">timestamp</span><span style="color: navy">, </span> bundle.type = <span style="color: blue">'document'</span><span style="color: navy">, </span> composition.date = <span style="color: maroon">timestamp</span><span style="color: navy">, </span> e2.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Patient'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">patient</span><span style="color: navy">, </span> patient.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid2</span><span style="color: navy">, </span> e2.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid2<span style="color: navy">)</span><span style="color: navy">, </span> bundle.entry<b> as </b><span style="color: maroon">e4</span><span style="color: navy">, </span> e4.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'QuestionnaireResponse'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">questionnaireresp</span><b> then</b><span style="color: navy"> {
</span> qr<b> then </b>QuestionnaireResponseMap<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">questionnaireresp</span><span style="color: navy">)</span> <i>"questionnaireresp"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span> questionnaireresp.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid4</span><span style="color: navy">, </span> e4.fullUrl = <b>append</b><span style="color: navy">(</span><span style="color: blue">'urn:uuid:'</span><span style="color: navy">, </span><span style="color: maroon">uuid4</span><span style="color: navy">)</span><span style="color: navy">, </span> bundle.entry<b> as </b><span style="color: maroon">e5</span><span style="color: navy">, </span> e5.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'ServiceRequest'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">servicerequest</span><span style="color: navy">, </span> servicerequest.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid5</span><span style="color: navy">, </span> e5.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid5<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> qr<b> then </b>OrfComposition<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">composition</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">, </span><span style="color: maroon">questionnaireresp</span><span style="color: navy">, </span><span style="color: maroon">servicerequest</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">)</span> <i>"composition"</i><span style="color: navy">;</span>
qr<b> then </b>QrToGroups<span style="color: navy">(</span><span style="color: maroon">questionnaireresp</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">composition</span><span style="color: navy">, </span><span style="color: maroon">servicerequest</span><span style="color: navy">)</span> <i>"orf"</i><span style="color: navy">;</span>
qr<b> then </b>RadOrderQrToServiceRequest<span style="color: navy">(</span><span style="color: maroon">questionnaireresp</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">composition</span><span style="color: navy">, </span><span style="color: maroon">servicerequest</span><span style="color: navy">)</span> <i>"servicerequest"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"servicerequest"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"orfbundle"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>RadOrderQrToServiceRequest<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">composition</span><span style="color: navy"> : </span>Composition, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'requestedService'<b> then </b>RequestedServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"requestedService"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'reason'<b> then </b>ReasonServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"reason"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'imagingService'<b> then </b>ImagingServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"imagingService"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'orderDetail'<b> then </b>OrderDetailServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"orderDetail"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'desiredRadiologist'<b> then </b>DesiredRadiologistServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"desiredRadiologist"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'diagnosisList'<b> then </b>DiagnosisListServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"diagnosisList"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'caveat'<b> then </b>CaveatServiceItems<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">)</span> <i>"Caveat"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'previousResults'<b> then</b><span style="color: navy"> {
</span> grp.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'attachedFile'<b> then </b>PreviousImagingStudyResultsNonDicom<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">)</span> <i>"attachment"</i><span style="color: navy">;</span>
grp.item<b> as </b><span style="color: maroon">grp</span><b> where </b>linkId = 'dicomObject'<b> then </b>PreviousImagingStudyResults<span style="color: navy">(</span><span style="color: maroon">grp</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">)</span> <i>"attachment"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"previousResults"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>RequestedServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'requestedService.service') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.category<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"requestedServiceService"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerCalueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>ReasonServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'reason.question') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>string<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> serviceRequest.reasonCode<b> as </b><span style="color: maroon">reasonCode</span><span style="color: navy">, </span> reasonCode.text = <span style="color: maroon">value</span> <i>"reasonQuestion"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>ImagingServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'imagingService.type') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding = <span style="color: maroon">coding</span> <i>"requestedServiceService"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>OrderDetailServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'orderDetail.imagingRegion') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.orderDetail<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.extension<b> as </b><span style="color: maroon">ext</span><span style="color: navy">, </span> ext.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> ext.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'imagingRegion'</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"orderDetailImagingRegion"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'orderDetail.imagingFocus') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.bodySite<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"orderDetailImagingFocus"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'orderDetail.laterality') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.orderDetail<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.extension<b> as </b><span style="color: maroon">ext</span><span style="color: navy">, </span> ext.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> ext.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'laterality'</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"orderDetailLaterality"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'orderDetail.viewType') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.orderDetail<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.extension<b> as </b><span style="color: maroon">ext</span><span style="color: navy">, </span> ext.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> ext.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'viewType'</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"orderDetailViewType"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'orderDetail.maneuverType') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.orderDetail<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.extension<b> as </b><span style="color: maroon">ext</span><span style="color: navy">, </span> ext.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> ext.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'maneuverType'</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"orderDetailManeuverType"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'orderDetail.guidanceForAction') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span> serviceRequest.orderDetail<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.extension<b> as </b><span style="color: maroon">ext</span><span style="color: navy">, </span> ext.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> ext.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'guidanceForAction'</span><span style="color: navy">, </span> cc.coding = <span style="color: maroon">coding</span> <i>"orderDetailGuidanceForAction"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>DesiredRadiologistServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src<span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Practitioner'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">practitioner</span><span style="color: navy">, </span> practitioner.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> serviceRequest.performer<b> as </b><span style="color: maroon">performer</span><span style="color: navy">, </span> performer.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'desiredRadiologist.familyName') and answer.exists())<span style="color: navy"><b> -> </b></span> practitioner.name<b> as </b><span style="color: maroon">name</span> <b>share</b> <b>name</b><span style="color: navy">, </span> name.family = <span style="color: navy">(</span>%item.answer.value<span style="color: navy">)</span><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'desiredRadiologist.givenName') and answer.exists())<span style="color: navy"><b> -> </b></span> practitioner.name<b> as </b><span style="color: maroon">name</span> <b>share</b> <b>name</b><span style="color: navy">, </span> name.given = <span style="color: navy">(</span>%item.answer.value<span style="color: navy">)</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"serviceRequestPerformer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>DiagnosisListServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'diagnosisList.primaryDiagnosis') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>string<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.reasonReference<b> as </b><span style="color: maroon">reasonReference</span><span style="color: navy">, </span> reasonReference.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.text = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"diagnosisListPrimaryDiagnosis"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'diagnosisList.secondaryDiagnosis') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>string<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.text = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"diagnosisListSecondaryDiagnosis"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'diagnosisList.bodyHeight') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observation</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> observation.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'vital-signs'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style="color: navy">, </span> observation.value = <span style="color: maroon">value</span><span style="color: navy">, </span> observation.code<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'8302-2'</span><span style="color: navy">, </span> observation.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"observationBodyHeight"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'diagnosisList.bodyWeight') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observation</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> observation.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'vital-signs'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style="color: navy">, </span> observation.value = <span style="color: maroon">value</span><span style="color: navy">, </span> observation.code<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'29463-7'</span><span style="color: navy">, </span> observation.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"observationBbodyWeight"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>CaveatServiceItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.bloodCoagulation') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'64779008'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Blood coagulation disorder (disorder)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'64779008'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Blood coagulation disorder (disorder)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> answer.item<b> as </b><span style="color: maroon">subitem</span><b> where </b>(linkId.value = 'caveatList.bloodCoagulation.INR')<span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observation</span><span style="color: navy">, </span> observation.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.evidence<b> as </b><span style="color: maroon">evidence</span><span style="color: navy">, </span> evidence.detail<b> as </b><span style="color: maroon">detail</span><span style="color: navy">, </span> detail.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.code<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'34714-6'</span><span style="color: navy">, </span> observation.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> subitem.item<b> as </b><span style="color: maroon">quantityitem</span><b> where </b>((linkId.value = 'caveatList.bloodCoagulation.INR.quantity') and answer.exists())<b> then</b><span style="color: navy"> {
</span> quantityitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.value = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRQuantityValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRQuantity"</i><span style="color: navy">;</span>
subitem.item<b> as </b><span style="color: maroon">datetimeitem</span><b> where </b>((linkId.value = 'caveatList.bloodCoagulation.INR.dateTime') and answer.exists())<b> then</b><span style="color: navy"> {
</span> datetimeitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>dateTime<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.effective = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRDateTimeValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRDateTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINR"</i><span style="color: navy">;</span>
answer.item<b> as </b><span style="color: maroon">subitem</span><b> where </b>(linkId.value = 'caveatList.bloodCoagulation.platelets')<span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observation</span><span style="color: navy">, </span> observation.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.evidence<b> as </b><span style="color: maroon">evidence</span><span style="color: navy">, </span> evidence.detail<b> as </b><span style="color: maroon">detail</span><span style="color: navy">, </span> detail.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.code<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'26515-7'</span><span style="color: navy">, </span> observation.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> subitem.item<b> as </b><span style="color: maroon">quantityitem</span><b> where </b>((linkId.value = 'caveatList.bloodCoagulation.platelets.quantity') and answer.exists())<b> then</b><span style="color: navy"> {
</span> quantityitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.value = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRPlateletsValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRPlatelets"</i><span style="color: navy">;</span>
subitem.item<b> as </b><span style="color: maroon">datetimeitem</span><b> where </b>((linkId.value = 'caveatList.bloodCoagulation.platelets.dateTime') and answer.exists())<b> then</b><span style="color: navy"> {
</span> datetimeitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>dateTime<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.effective = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRPlateletsValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRPlatelets"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINR"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"bloodCoagulation"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.renalInsufficiency') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'723188008'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Renal insufficiency (disorder)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'723188008'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Renal insufficiency (disorder)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> answer.item<b> as </b><span style="color: maroon">subitem</span><b> where </b>(linkId.value = 'caveatList.renalInsufficiency.creatinineClearance')<span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observation</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> observation.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.evidence<b> as </b><span style="color: maroon">evidence</span><span style="color: navy">, </span> evidence.detail<b> as </b><span style="color: maroon">detail</span><span style="color: navy">, </span> detail.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.code<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'33558-8'</span><span style="color: navy">, </span> observation.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> subitem.item<b> as </b><span style="color: maroon">quantityitem</span><b> where </b>((linkId.value = 'caveatList.renalInsufficiency.creatinineClearance.quantity') and answer.exists())<b> then</b><span style="color: navy"> {
</span> quantityitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.value = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinineClearanceQuantityValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinineClearanceQuantity"</i><span style="color: navy">;</span>
subitem.item<b> as </b><span style="color: maroon">datetimeitem</span><b> where </b>((linkId.value = 'caveatList.renalInsufficiency.creatinineClearance.dateTime') and answer.exists())<b> then</b><span style="color: navy"> {
</span> datetimeitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>dateTime<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.effective = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinineClearanceDateTimeValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinineClearancedateTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinineClearanceINR"</i><span style="color: navy">;</span>
answer.item<b> as </b><span style="color: maroon">subitem</span><b> where </b>(linkId.value = 'caveatList.renalInsufficiency.creatinine')<span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observation</span><span style="color: navy">, </span> observation.status = <span style="color: blue">'final'</span><span style="color: navy">, </span> observation.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.evidence<b> as </b><span style="color: maroon">evidence</span><span style="color: navy">, </span> evidence.detail<b> as </b><span style="color: maroon">detail</span><span style="color: navy">, </span> detail.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> observation.code<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'77140-2'</span><span style="color: navy">, </span> observation.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> subitem.item<b> as </b><span style="color: maroon">quantityitem</span><b> where </b>((linkId.value = 'caveatList.renalInsufficiency.creatinine.quantity') and answer.exists())<b> then</b><span style="color: navy"> {
</span> quantityitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.value = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinineValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinine"</i><span style="color: navy">;</span>
subitem.item<b> as </b><span style="color: maroon">datetimeitem</span><b> where </b>((linkId.value = 'caveatList.renalInsufficiency.creatinine.dateTime') and answer.exists())<b> then</b><span style="color: navy"> {
</span> datetimeitem.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>dateTime<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>observation.effective = <span style="color: maroon">value</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatininevalue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatBloodCoagulationINRPlatelets"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListRenalInsufficiencyCreatinine"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"bloodCoagulation"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.claustrophobia') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'19887002'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Claustrophobia (finding)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'19887002'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Claustrophobia (finding)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListClaustrophobia"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.bodyPiercing') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'879862001'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Body piercing (finding)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'879862001'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Body piercing (finding)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListBodyPiercing"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.device') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'397578001'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Device in situ (finding)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'52101004'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Present (qualifier value)'</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListDevice"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.hyperthyroidism') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'34486009'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Hyperthyroidism (disorder)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'34486009'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Hyperthyroidism (disorder)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListHyperthyroidism"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.diabetes') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'73211009'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Diabetes mellitus (disorder)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'73211009'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Diabetes mellitus (disorder)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListDiabetes"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.gravida') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'366321006'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Finding of gravida (finding)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'366321006'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Finding of gravida (finding)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListGravida"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>((linkId.value = 'caveatList.contrastMediaAllergy') and answer.exists())<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'293637006'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Allergy to contrast media (finding)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'293637006'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Allergy to contrast media (finding)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListContrastMediaAllergy"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">"caveatListDrugPrescription.metformin"</span>
<span style="color: navy">// </span><span style="color: green">caveatList.drugPrescription.betaBlocke</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'caveatList.drugPrescription')<b> then </b>DesiredRadiologistServiceItemsDrugDescription<span style="color: navy">(</span><span style="color: maroon">item</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">serviceRequest</span><span style="color: navy">, </span><span style="color: maroon">patient</span><span style="color: navy">)</span> <i>"DrugPrescription"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>DesiredRadiologistServiceItemsDrugDescription<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest, <b>target</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span> src.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'caveatList.drugPrescription.metformin')<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'182817000'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Drug prescription (situation)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'372567009'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Metformin (substance)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListDrugPrescription"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListDrugPrescriptionMetformin"</i><span style="color: navy">;</span>
src.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'caveatList.drugPrescription.betaBlocker')<b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condition</span><span style="color: navy">, </span> condition.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> e.fullUrl = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext1</span><span style="color: navy">, </span> ext1.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type'</span><span style="color: navy">, </span> ext1.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'182817000'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Drug prescription (situation)'</span><span style="color: navy">, </span> condition.extension<b> as </b><span style="color: maroon">ext2</span><span style="color: navy">, </span> ext2.url = <span style="color: blue">'http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value'</span><span style="color: navy">, </span> ext2.value = <span style="color: maroon">value</span><span style="color: navy">, </span> condition.category<b> as </b><span style="color: maroon">category</span><span style="color: navy">, </span> category.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'problem-list-item'</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-category'</span><span style="color: navy">, </span> coding.display = <span style="color: blue">'Problem List Item'</span><span style="color: navy">, </span> condition.code<b> as </b><span style="color: maroon">code</span><span style="color: navy">, </span> code.coding<b> as </b><span style="color: maroon">coding2</span><span style="color: navy">, </span> coding2.code = <span style="color: blue">'373254001'</span><span style="color: navy">, </span> coding2.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> coding2.display = <span style="color: blue">'Substance with beta adrenergic receptor antagonist mechanism of action (substance)'</span><span style="color: navy">, </span> condition.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span> <i>"caveatListDrugPrescription"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"caveatListDrugPrescriptionBetaBlocker"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>PreviousImagingStudyResultsNonDicom<span style="color: navy">(</span><b>source</b> <span style="color: maroon">item</span>, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest, <b>target</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span> item<b> as </b><span style="color: maroon">item</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'DocumentReference'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">documentReference</span><span style="color: navy">, </span> documentReference.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> documentReference.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><span style="color: navy">, </span> e.fullUrl = <b>append</b><span style="color: navy">(</span><span style="color: blue">'urn:uuid:'</span><span style="color: navy">, </span><span style="color: maroon">uuid</span><span style="color: navy">)</span><span style="color: navy">, </span> documentReference.status = <span style="color: blue">'current'</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><span style="color: navy"><b> -> </b></span> documentReference.content<b> as </b><span style="color: maroon">content</span><span style="color: navy">, </span> content.attachment = <span style="color: navy">(</span>%answer.value<span style="color: navy">)</span><b> as </b><span style="color: maroon">attachment</span><b> then</b><span style="color: navy"> {
</span> answer.item<b> as </b><span style="color: maroon">dictomitem</span><b> where </b>((linkId.value = 'attachedFile.description') and answer.exists())<span style="color: navy"><b> -> </b></span>documentReference.description = <span style="color: navy">(</span>%dictomitem.answer.value<span style="color: navy">)</span> <i>"description"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"itemAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>PreviousImagingStudyResults<span style="color: navy">(</span><b>source</b> <span style="color: maroon">item</span>, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">serviceRequest</span><span style="color: navy"> : </span>ServiceRequest, <b>target</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span> item<b> as </b><span style="color: maroon">item</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">e</span><span style="color: navy">, </span> e.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'ImagingStudy'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">imagingStudy</span><span style="color: navy">, </span> imagingStudy.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">uuid</span><span style="color: navy">, </span> imagingStudy.status = <span style="color: blue">'available'</span><span style="color: navy">, </span> imagingStudy.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><span style="color: navy">, </span> e.fullUrl = <b>append</b><span style="color: navy">(</span><span style="color: blue">'urn:uuid:'</span><span style="color: navy">, </span><span style="color: maroon">uuid</span><span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.subject<b> as </b><span style="color: maroon">subject</span><span style="color: navy">, </span> subject.reference = <span style="color: navy">(</span>'urn:uuid:' + %patient.id<span style="color: navy">)</span><span style="color: navy">, </span> serviceRequest.supportingInfo<b> as </b><span style="color: maroon">supportingInfo</span><span style="color: navy">, </span> imagingStudy.series<b> as </b><span style="color: maroon">series</span><span style="color: navy">, </span> series.instance<b> as </b><span style="color: maroon">instance</span><span style="color: navy">, </span> supportingInfo.reference = <span style="color: navy">(</span>'urn:uuid:' + %uuid<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> item.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
</span> answer.value<span style="color: navy"> : </span>string<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>imagingStudy.description = <span style="color: maroon">value</span> <i>"description"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"answerValueString"</i><span style="color: navy">;</span>
item.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'dicomObject.sopInstanceUid') and answer.exists()<span style="color: navy"><b> -> </b></span>instance.uid = <span style="color: navy">(</span>%item.answer.value<span style="color: navy">)</span> <i>"uid"</i><span style="color: navy">;</span>
item.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'dicomObject.modality') and answer.exists()<span style="color: navy"><b> -> </b></span> series.modality<b> as </b><span style="color: maroon">modality</span><span style="color: navy">, </span> modality.code = <span style="color: navy">(</span>%item.answer.value.code<span style="color: navy">)</span> <i>"modality"</i><span style="color: navy">;</span>
item.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'dicomObject.studyInstanceUid') and answer.exists()<span style="color: navy"><b> -> </b></span> imagingStudy.identifier<b> as </b><span style="color: maroon">uid</span><span style="color: navy">, </span> uid.type<b> as </b><span style="color: maroon">type</span><span style="color: navy">, </span> type.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'urn:dicom:uid'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'PLAC'</span><span style="color: navy">, </span> uid.value = <span style="color: navy">(</span>%item.answer.value<span style="color: navy">)</span> <i>"uid"</i><span style="color: navy">;</span>
item.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'dicomObject.SeriesInstanceUid') and answer.exists()<span style="color: navy"><b> -> </b></span>series.uid = <span style="color: navy">(</span>%item.answer.value<span style="color: navy">)</span> <i>"attachmentdicomSeriesInstanceUid"</i><span style="color: navy">;</span>
item.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId.value = 'dicomObject.acsn') and answer.exists()<span style="color: navy"><b> -> </b></span> imagingStudy.identifier<b> as </b><span style="color: maroon">acsn</span><span style="color: navy">, </span> acsn.type<b> as </b><span style="color: maroon">type</span><span style="color: navy">, </span> type.coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/v2-0203'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'ACSN'</span><span style="color: navy">, </span> acsn.value = <span style="color: navy">(</span>%item.answer.value<span style="color: navy">)</span> <i>"acsn"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"supportingInfo"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="http://fhir.ch/ig/ch-rad-order/StructureMap/RadOrderQrToBundle"/>
<version value="2.0.0-ballot"/>
<name value="RadOrderQrToBundle"/>
<status value="draft"/>
<date value="2024-05-17T11:21:51+00:00"/>
<publisher value="HL7 Switzerland"/>
<contact>
<name value="Juerg P. Bleuer"/>
<telecom>
<system value="url"/>
<value value="https://www.hl7.ch"/>
</telecom>
</contact>
<description
value="Radiologoy QuestionnaireResponse to Bundle
Derived from ORF QuestionnaireResponse to Bundle
2021-01-11 Oliver Egger, copyright ahdis ag, Apache License
QRF Questionnaire: http://fhir.ch/ig/ch-orf/Questionnaire-order-referral-form.html
QRF QuestionnaireResponse: http://fhir.ch/ig/ch-orf/QuestionnaireResponse-order-referral-form.xml.html
Bundle: http://fhir.ch/ig/ch-orf/StructureDefinition-ch-orf-document.html"/>
<jurisdiction>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="CH"/>
</coding>
</jurisdiction>
<copyright value="CC0-1.0"/>
<structure>
<url
value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
<mode value="source"/>
<alias value="QuestionnaireResponse"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
<mode value="target"/>
<alias value="Bundle"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Composition"/>
<mode value="target"/>
<alias value="Composition"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="target"/>
<alias value="Patient"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/RelatedPerson"/>
<mode value="target"/>
<alias value="RelatedPerson"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Organization"/>
<mode value="target"/>
<alias value="Organization"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
<mode value="target"/>
<alias value="Practitioner"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/PractitionerRole"/>
<mode value="target"/>
<alias value="PractitionerRole"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
<mode value="target"/>
<alias value="ServiceRequest"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Extension"/>
<mode value="target"/>
<alias value="Extension"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"/>
<mode value="target"/>
<alias value="EpisodeOfCare"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
<mode value="target"/>
<alias value="QuestionnaireResponseTarget"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
<mode value="source"/>
<alias value="QuestionnaireResponse"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
<mode value="target"/>
<alias value="Bundle"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="target"/>
<alias value="Patient"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Organization"/>
<mode value="target"/>
<alias value="Organization"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
<mode value="target"/>
<alias value="Practitioner"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/PractitionerRole"/>
<mode value="target"/>
<alias value="PractitionerRole"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
<mode value="target"/>
<alias value="ServiceRequest"/>
</structure>
<import value="http://fhir.ch/ig/ch-orf/StructureMap/OrfQrToBundle"/>
<group>
<name value="RadOrderQrToBundle"/>
<typeMode value="none"/>
<input>
<name value="qr"/>
<type value="QuestionnaireResponse"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="documentIdentifier"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="documentIdentifier"/>
</target>
<target>
<context value="documentIdentifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="urn:ietf:rfc:3986"/>
</parameter>
</target>
<target>
<contextType value="variable"/>
<variable value="uuidDoc"/>
<transform value="uuid"/>
</target>
<target>
<context value="documentIdentifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuidDoc"/>
</parameter>
</target>
</rule>
<rule>
<name value="orfbundle"/>
<source>
<context value="qr"/>
<variable value="qrcp"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="composition"/>
<transform value="create"/>
<parameter>
<valueString value="Composition"/>
</parameter>
</target>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="title"/>
<transform value="copy"/>
<parameter>
<valueString value="Radiologieauftrag"/>
</parameter>
</target>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="type"/>
</target>
<target>
<context value="type"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="2161000195103"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="urn:oid:2.16.756.5.30.1.127.3.4"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Imaging order (record artifact)"/>
</parameter>
</target>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="721963009"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Order (record artifact)"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e2"/>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="timestamp"/>
<variable value="timestamp"/>
<transform value="evaluate"/>
<parameter>
<valueString value="now()"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="document"/>
</parameter>
</target>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="date"/>
<transform value="copy"/>
<parameter>
<valueId value="timestamp"/>
</parameter>
</target>
<target>
<context value="e2"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="patient"/>
<transform value="create"/>
<parameter>
<valueString value="Patient"/>
</parameter>
</target>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<transform value="uuid"/>
</target>
<target>
<context value="e2"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid2"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e4"/>
</target>
<target>
<context value="e4"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="questionnaireresp"/>
<transform value="create"/>
<parameter>
<valueString value="QuestionnaireResponse"/>
</parameter>
</target>
<rule>
<name value="questionnaireresp"/>
<source>
<context value="qr"/>
</source>
<dependent>
<name value="QuestionnaireResponseMap"/>
<variable value="qr"/>
<variable value="questionnaireresp"/>
</dependent>
</rule>
<rule>
<name value="servicerequest"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="questionnaireresp"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid4"/>
<transform value="uuid"/>
</target>
<target>
<context value="e4"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid4"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e5"/>
</target>
<target>
<context value="e5"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="servicerequest"/>
<transform value="create"/>
<parameter>
<valueString value="ServiceRequest"/>
</parameter>
</target>
<target>
<context value="servicerequest"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid5"/>
<transform value="uuid"/>
</target>
<target>
<context value="e5"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid5"/>
</parameter>
</target>
<rule>
<name value="composition"/>
<source>
<context value="qr"/>
</source>
<dependent>
<name value="OrfComposition"/>
<variable value="qr"/>
<variable value="composition"/>
<variable value="patient"/>
<variable value="questionnaireresp"/>
<variable value="servicerequest"/>
<variable value="bundle"/>
</dependent>
</rule>
<rule>
<name value="orf"/>
<source>
<context value="qr"/>
</source>
<dependent>
<name value="QrToGroups"/>
<variable value="questionnaireresp"/>
<variable value="patient"/>
<variable value="bundle"/>
<variable value="composition"/>
<variable value="servicerequest"/>
</dependent>
</rule>
<rule>
<name value="servicerequest"/>
<source>
<context value="qr"/>
</source>
<dependent>
<name value="RadOrderQrToServiceRequest"/>
<variable value="questionnaireresp"/>
<variable value="patient"/>
<variable value="bundle"/>
<variable value="composition"/>
<variable value="servicerequest"/>
</dependent>
</rule>
</rule>
</rule>
</group>
<group>
<name value="RadOrderQrToServiceRequest"/>
<typeMode value="none"/>
<input>
<name value="qr"/>
<type value="QuestionnaireResponse"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="composition"/>
<type value="Composition"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="requestedService"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'requestedService'"/>
</source>
<dependent>
<name value="RequestedServiceItems"/>
<variable value="grp"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="reason"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'reason'"/>
</source>
<dependent>
<name value="ReasonServiceItems"/>
<variable value="grp"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="imagingService"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'imagingService'"/>
</source>
<dependent>
<name value="ImagingServiceItems"/>
<variable value="grp"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="orderDetail"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'orderDetail'"/>
</source>
<dependent>
<name value="OrderDetailServiceItems"/>
<variable value="grp"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="desiredRadiologist"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'desiredRadiologist'"/>
</source>
<dependent>
<name value="DesiredRadiologistServiceItems"/>
<variable value="grp"/>
<variable value="bundle"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="diagnosisList"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'diagnosisList'"/>
</source>
<dependent>
<name value="DiagnosisListServiceItems"/>
<variable value="grp"/>
<variable value="patient"/>
<variable value="bundle"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="Caveat"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'caveat'"/>
</source>
<dependent>
<name value="CaveatServiceItems"/>
<variable value="grp"/>
<variable value="patient"/>
<variable value="bundle"/>
<variable value="serviceRequest"/>
</dependent>
</rule>
<rule>
<name value="previousResults"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'previousResults'"/>
</source>
<rule>
<name value="attachment"/>
<source>
<context value="grp"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'attachedFile'"/>
</source>
<dependent>
<name value="PreviousImagingStudyResultsNonDicom"/>
<variable value="grp"/>
<variable value="bundle"/>
<variable value="serviceRequest"/>
<variable value="patient"/>
</dependent>
</rule>
<rule>
<name value="attachment"/>
<source>
<context value="grp"/>
<element value="item"/>
<variable value="grp"/>
<condition value="linkId = 'dicomObject'"/>
</source>
<dependent>
<name value="PreviousImagingStudyResults"/>
<variable value="grp"/>
<variable value="bundle"/>
<variable value="serviceRequest"/>
<variable value="patient"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="RequestedServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'requestedService.service') and answer.exists())"/>
</source>
<rule>
<name value="answerCalueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="requestedServiceService"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ReasonServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'reason.question') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="reasonQuestion"/>
<source>
<context value="answer"/>
<type value="string"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="reasonCode"/>
<variable value="reasonCode"/>
</target>
<target>
<context value="reasonCode"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ImagingServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'imagingService.type') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="requestedServiceService"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="OrderDetailServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'orderDetail.imagingRegion') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="orderDetailImagingRegion"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="orderDetail"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="imagingRegion"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'orderDetail.imagingFocus') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="orderDetailImagingFocus"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="bodySite"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'orderDetail.laterality') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="orderDetailLaterality"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="orderDetail"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="laterality"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'orderDetail.viewType') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="orderDetailViewType"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="orderDetail"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="viewType"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'orderDetail.maneuverType') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="orderDetailManeuverType"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="orderDetail"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="maneuverType"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'orderDetail.guidanceForAction') and answer.exists())"/>
</source>
<rule>
<name value="answerValueCoding"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="orderDetailGuidanceForAction"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="coding"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="orderDetail"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/CodeSystem/ch-rad-order-order-detail-type"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="guidanceForAction"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="DesiredRadiologistServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="serviceRequestPerformer"/>
<source>
<context value="src"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="performer"/>
<variable value="performer"/>
</target>
<target>
<context value="performer"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<rule>
<name value="item"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'desiredRadiologist.familyName') and answer.exists())"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="name"/>
<listMode value="share"/>
<listRuleId value="name"/>
</target>
<target>
<context value="name"/>
<contextType value="variable"/>
<element value="family"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="item"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'desiredRadiologist.givenName') and answer.exists())"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="name"/>
<listMode value="share"/>
<listRuleId value="name"/>
</target>
<target>
<context value="name"/>
<contextType value="variable"/>
<element value="given"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="DiagnosisListServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'diagnosisList.primaryDiagnosis') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="diagnosisListPrimaryDiagnosis"/>
<source>
<context value="answer"/>
<type value="string"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="reasonReference"/>
<variable value="reasonReference"/>
</target>
<target>
<context value="reasonReference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'diagnosisList.secondaryDiagnosis') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="diagnosisListSecondaryDiagnosis"/>
<source>
<context value="answer"/>
<type value="string"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'diagnosisList.bodyHeight') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="observationBodyHeight"/>
<source>
<context value="answer"/>
<type value="Quantity"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="vital-signs"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="c"/>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="8302-2"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'diagnosisList.bodyWeight') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="observationBbodyWeight"/>
<source>
<context value="answer"/>
<type value="Quantity"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="vital-signs"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="c"/>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="29463-7"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="CaveatServiceItems"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.bloodCoagulation') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="bloodCoagulation"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="64779008"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Blood coagulation disorder (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="64779008"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Blood coagulation disorder (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<rule>
<name value="caveatBloodCoagulationINR"/>
<source>
<context value="answer"/>
<element value="item"/>
<variable value="subitem"/>
<condition
value="(linkId.value = 'caveatList.bloodCoagulation.INR')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="evidence"/>
<variable value="evidence"/>
</target>
<target>
<context value="evidence"/>
<contextType value="variable"/>
<element value="detail"/>
<variable value="detail"/>
</target>
<target>
<context value="detail"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="c"/>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="34714-6"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<rule>
<name value="caveatBloodCoagulationINRQuantity"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="quantityitem"/>
<condition
value="((linkId.value = 'caveatList.bloodCoagulation.INR.quantity') and answer.exists())"/>
</source>
<rule>
<name value="caveatBloodCoagulationINRQuantityValue"/>
<source>
<context value="quantityitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="Quantity"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="caveatBloodCoagulationINRDateTime"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="datetimeitem"/>
<condition
value="((linkId.value = 'caveatList.bloodCoagulation.INR.dateTime') and answer.exists())"/>
</source>
<rule>
<name value="caveatBloodCoagulationINRDateTimeValue"/>
<source>
<context value="datetimeitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="dateTime"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="effective"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="caveatBloodCoagulationINR"/>
<source>
<context value="answer"/>
<element value="item"/>
<variable value="subitem"/>
<condition
value="(linkId.value = 'caveatList.bloodCoagulation.platelets')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="evidence"/>
<variable value="evidence"/>
</target>
<target>
<context value="evidence"/>
<contextType value="variable"/>
<element value="detail"/>
<variable value="detail"/>
</target>
<target>
<context value="detail"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="c"/>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="26515-7"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<rule>
<name value="caveatBloodCoagulationINRPlatelets"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="quantityitem"/>
<condition
value="((linkId.value = 'caveatList.bloodCoagulation.platelets.quantity') and answer.exists())"/>
</source>
<rule>
<name value="caveatBloodCoagulationINRPlateletsValue"/>
<source>
<context value="quantityitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="Quantity"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="caveatBloodCoagulationINRPlatelets"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="datetimeitem"/>
<condition
value="((linkId.value = 'caveatList.bloodCoagulation.platelets.dateTime') and answer.exists())"/>
</source>
<rule>
<name value="caveatBloodCoagulationINRPlateletsValue"/>
<source>
<context value="datetimeitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="dateTime"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="effective"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.renalInsufficiency') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="bloodCoagulation"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="723188008"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Renal insufficiency (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="723188008"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Renal insufficiency (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<rule>
<name value="caveatListRenalInsufficiencyCreatinineClearanceINR"/>
<source>
<context value="answer"/>
<element value="item"/>
<variable value="subitem"/>
<condition
value="(linkId.value = 'caveatList.renalInsufficiency.creatinineClearance')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="evidence"/>
<variable value="evidence"/>
</target>
<target>
<context value="evidence"/>
<contextType value="variable"/>
<element value="detail"/>
<variable value="detail"/>
</target>
<target>
<context value="detail"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="c"/>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="33558-8"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<rule>
<name
value="caveatListRenalInsufficiencyCreatinineClearanceQuantity"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="quantityitem"/>
<condition
value="((linkId.value = 'caveatList.renalInsufficiency.creatinineClearance.quantity') and answer.exists())"/>
</source>
<rule>
<name
value="caveatListRenalInsufficiencyCreatinineClearanceQuantityValue"/>
<source>
<context value="quantityitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="Quantity"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name
value="caveatListRenalInsufficiencyCreatinineClearancedateTime"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="datetimeitem"/>
<condition
value="((linkId.value = 'caveatList.renalInsufficiency.creatinineClearance.dateTime') and answer.exists())"/>
</source>
<rule>
<name
value="caveatListRenalInsufficiencyCreatinineClearanceDateTimeValue"/>
<source>
<context value="datetimeitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="dateTime"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="effective"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="caveatListRenalInsufficiencyCreatinine"/>
<source>
<context value="answer"/>
<element value="item"/>
<variable value="subitem"/>
<condition
value="(linkId.value = 'caveatList.renalInsufficiency.creatinine')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="evidence"/>
<variable value="evidence"/>
</target>
<target>
<context value="evidence"/>
<contextType value="variable"/>
<element value="detail"/>
<variable value="detail"/>
</target>
<target>
<context value="detail"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="c"/>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
<target>
<context value="c"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="77140-2"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<rule>
<name value="caveatListRenalInsufficiencyCreatinine"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="quantityitem"/>
<condition
value="((linkId.value = 'caveatList.renalInsufficiency.creatinine.quantity') and answer.exists())"/>
</source>
<rule>
<name value="caveatListRenalInsufficiencyCreatinineValue"/>
<source>
<context value="quantityitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="Quantity"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="caveatBloodCoagulationINRPlatelets"/>
<source>
<context value="subitem"/>
<element value="item"/>
<variable value="datetimeitem"/>
<condition
value="((linkId.value = 'caveatList.renalInsufficiency.creatinine.dateTime') and answer.exists())"/>
</source>
<rule>
<name value="caveatListRenalInsufficiencyCreatininevalue"/>
<source>
<context value="datetimeitem"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="answer"/>
<type value="dateTime"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="effective"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.claustrophobia') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListClaustrophobia"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="19887002"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Claustrophobia (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="19887002"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Claustrophobia (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.bodyPiercing') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListBodyPiercing"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="879862001"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Body piercing (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="879862001"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Body piercing (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.device') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListDevice"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="397578001"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Device in situ (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="52101004"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Present (qualifier value)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.hyperthyroidism') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListHyperthyroidism"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="34486009"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Hyperthyroidism (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="34486009"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Hyperthyroidism (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.diabetes') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListDiabetes"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="73211009"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Diabetes mellitus (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="73211009"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Diabetes mellitus (disorder)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.gravida') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListGravida"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="366321006"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Finding of gravida (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="366321006"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Finding of gravida (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="itemAnswer"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="((linkId.value = 'caveatList.contrastMediaAllergy') and answer.exists())"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListContrastMediaAllergy"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="293637006"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Allergy to contrast media (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="293637006"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Allergy to contrast media (finding)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="DrugPrescription"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition value="(linkId.value = 'caveatList.drugPrescription')"/>
</source>
<dependent>
<name value="DesiredRadiologistServiceItemsDrugDescription"/>
<variable value="item"/>
<variable value="bundle"/>
<variable value="serviceRequest"/>
<variable value="patient"/>
</dependent>
</rule>
</group>
<group>
<name value="DesiredRadiologistServiceItemsDrugDescription"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<rule>
<name value="caveatListDrugPrescriptionMetformin"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'caveatList.drugPrescription.metformin')"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListDrugPrescription"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="182817000"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Drug prescription (situation)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="372567009"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Metformin (substance)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="caveatListDrugPrescriptionBetaBlocker"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'caveatList.drugPrescription.betaBlocker')"/>
</source>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="caveatListDrugPrescription"/>
<source>
<context value="answer"/>
<type value="Coding"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-caveat-type"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="182817000"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Drug prescription (situation)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext2"/>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-rad-order/StructureDefinition/ch-rad-order-qualifier-value"/>
</parameter>
</target>
<target>
<context value="ext2"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="category"/>
</target>
<target>
<context value="category"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="problem-list-item"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-category"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem List Item"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding2"/>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="373254001"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding2"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString
value="Substance with beta adrenergic receptor antagonist mechanism of action (substance)"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="PreviousImagingStudyResultsNonDicom"/>
<typeMode value="none"/>
<input>
<name value="item"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<rule>
<name value="itemAnswer"/>
<source>
<context value="item"/>
<variable value="item"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="documentReference"/>
<transform value="create"/>
<parameter>
<valueString value="DocumentReference"/>
</parameter>
</target>
<target>
<context value="documentReference"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="documentReference"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid"/>
</parameter>
</target>
<target>
<context value="documentReference"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="current"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<target>
<context value="documentReference"/>
<contextType value="variable"/>
<element value="content"/>
<variable value="content"/>
</target>
<target>
<context value="content"/>
<contextType value="variable"/>
<element value="attachment"/>
<variable value="attachment"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%answer.value"/>
</parameter>
</target>
<rule>
<name value="description"/>
<source>
<context value="answer"/>
<element value="item"/>
<variable value="dictomitem"/>
<condition
value="((linkId.value = 'attachedFile.description') and answer.exists())"/>
</source>
<target>
<context value="documentReference"/>
<contextType value="variable"/>
<element value="description"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%dictomitem.answer.value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="PreviousImagingStudyResults"/>
<typeMode value="none"/>
<input>
<name value="item"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="serviceRequest"/>
<type value="ServiceRequest"/>
<mode value="target"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<rule>
<name value="supportingInfo"/>
<source>
<context value="item"/>
<variable value="item"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="imagingStudy"/>
<transform value="create"/>
<parameter>
<valueString value="ImagingStudy"/>
</parameter>
</target>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="available"/>
</parameter>
</target>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="subject"/>
</target>
<target>
<context value="subject"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %patient.id"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="supportingInfo"/>
<variable value="supportingInfo"/>
</target>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="series"/>
<variable value="series"/>
</target>
<target>
<context value="series"/>
<contextType value="variable"/>
<element value="instance"/>
<variable value="instance"/>
</target>
<target>
<context value="supportingInfo"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %uuid"/>
</parameter>
</target>
<rule>
<name value="answerValueString"/>
<source>
<context value="item"/>
<element value="answer"/>
<variable value="answer"/>
</source>
<rule>
<name value="description"/>
<source>
<context value="answer"/>
<type value="string"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="description"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="uid"/>
<source>
<context value="item"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'dicomObject.sopInstanceUid') and answer.exists()"/>
</source>
<target>
<context value="instance"/>
<contextType value="variable"/>
<element value="uid"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="modality"/>
<source>
<context value="item"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'dicomObject.modality') and answer.exists()"/>
</source>
<target>
<context value="series"/>
<contextType value="variable"/>
<element value="modality"/>
<variable value="modality"/>
</target>
<target>
<context value="modality"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value.code"/>
</parameter>
</target>
</rule>
<rule>
<name value="uid"/>
<source>
<context value="item"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'dicomObject.studyInstanceUid') and answer.exists()"/>
</source>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="uid"/>
</target>
<target>
<context value="uid"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="type"/>
</target>
<target>
<context value="type"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="urn:dicom:uid"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="PLAC"/>
</parameter>
</target>
<target>
<context value="uid"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="attachmentdicomSeriesInstanceUid"/>
<source>
<context value="item"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'dicomObject.SeriesInstanceUid') and answer.exists()"/>
</source>
<target>
<context value="series"/>
<contextType value="variable"/>
<element value="uid"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="acsn"/>
<source>
<context value="item"/>
<element value="item"/>
<variable value="item"/>
<condition
value="(linkId.value = 'dicomObject.acsn') and answer.exists()"/>
</source>
<target>
<context value="imagingStudy"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="acsn"/>
</target>
<target>
<context value="acsn"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="type"/>
</target>
<target>
<context value="type"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="ACSN"/>
</parameter>
</target>
<target>
<context value="acsn"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%item.answer.value"/>
</parameter>
</target>
</rule>
</rule>
</group>
</StructureMap>