SGHI FHIR Profile Implementation Guide
0.1.0 - ci-build
SGHI FHIR Profile Implementation Guide, published by Kathurima Kimathi. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/savannahghi/sil_fhir_profile_ig/ and changes regularly. See the Directory of published versions
| Active as of 2026-09-14 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="ExtractIcuObservationChart"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap ExtractIcuObservationChart</b></p><a name="ExtractIcuObservationChart"> </a><a name="hcExtractIcuObservationChart"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureMap/ExtractIcuObservationChart'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'ExtractIcuObservationChart'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'ICU Observation Chart Extraction'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>
<span style="color: #cc00cc">/// <b>description</b> = </span><span style="color: blue">'Each round out as: the four vitals and the central venous pressure as their own Observations; the arterial blood gas as one panel with seven components, because a gas is interpreted whole and a pH of 7.25 means one thing beside a pCO2 of 8 and another beside a bicarbonate of 12; and the ventilator settings as a second panel. Every one takes the round\'s own time rather than the form\'s -- a deteriorating gas exchange is only visible as a series, and collapsing twenty-four rounds onto one instant would destroy it.'</span>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R5/questionnaireresponse.html" title="QuestionnaireResponse">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style="color: navy">" </span><b>alias </b>QR <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R5/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/R5/observation.html" title="Observation">http://hl7.org/fhir/StructureDefinition/Observation</a><span style="color: navy">" </span><b>alias </b>Observation <b>as </b><b>target</b>
<b>group </b>ExtractIcuObservationChart<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <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.type = <span style="color: blue">'transaction'</span> <i>"setBundleType"</i><span style="color: navy">;</span>
qr.item<b> as </b><span style="color: maroon">g</span><b> where </b><span style="color: navy">(</span>linkId = 'unit'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'unit/day-in-unit') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetSurveyCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'obs-day-in-unit'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Day in unit'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>obs.value = <span style="color: maroon">v</span> <i>"set"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"measure_labour_stage_duration"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'unit/diagnosis') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetSurveyCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'11450-4'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Problem list - Reported'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cc.text = <span style="color: blue">'Diagnosis on the ICU observation chart'</span> <i>"codeText"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">txt</span><span style="color: navy"><b> -> </b></span> obs.note<b> as </b><span style="color: maroon">n</span><span style="color: navy">, </span> n.text = <span style="color: maroon">txt</span> <i>"text"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"narr_11450_4"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'unit/instructions') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetSurveyCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'18776-5'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Plan of care note'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cc.text = <span style="color: blue">'Instructions on the ICU observation chart'</span> <i>"codeText"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">txt</span><span style="color: navy"><b> -> </b></span> obs.note<b> as </b><span style="color: maroon">n</span><span style="color: navy">, </span> n.text = <span style="color: maroon">txt</span> <i>"text"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"narr_18776_5"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"unitGroup"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">── One round ───────────────────────────────────────────────────────────</span>
qr.item<b> as </b><span style="color: maroon">g</span><b> where </b><span style="color: navy">(</span>linkId = 'round'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/vitals/temperature') and answer.value.ofType(Quantity).exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetVitalSignsCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'8310-5'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Body temperature'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>obs.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"vital_8310_5"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/vitals/pulse') and answer.value.ofType(Quantity).exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetVitalSignsCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'8867-4'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Heart rate'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>obs.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"vital_8867_4"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/vitals/respiratory-rate') and answer.value.ofType(Quantity).exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetVitalSignsCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'9279-1'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Respiratory rate'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>obs.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"vital_9279_1"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/cvp') and answer.value.ofType(Quantity).exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetVitalSignsCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'60985-9'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Central venous pressure (CVP)'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>obs.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"vital_60985_9"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">Blood pressure as typed. The chart is a graph with a systolic and a</span>
<span style="color: navy">// </span><span style="color: green">diastolic plotted against each other; the digital form takes the pair as</span>
<span style="color: navy">// </span><span style="color: green">one string rather than parsing it, because a mis-parsed blood pressure is</span>
<span style="color: navy">// </span><span style="color: green">worse than a legible one.</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/vitals/blood-pressure') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetVitalSignsCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'85354-9'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Blood pressure panel with all children optional'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">txt</span><span style="color: navy"><b> -> </b></span> obs.note<b> as </b><span style="color: maroon">n</span><span style="color: navy">, </span> n.text = <span style="color: maroon">txt</span> <i>"bpText"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"roundBloodPressure"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">── The arterial blood gas, as one panel ──────────────────────────────</span>
g.item<b> as </b><span style="color: maroon">abg</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg') and item.answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetLaboratoryCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
abg<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> abg<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> abg<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
abg<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'24336-0'</span> <i>"cd"</i><span style="color: navy">;</span>
abg<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Gas panel - Arterial blood'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/ph') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'2744-1'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'pH of Arterial blood'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_2744_1"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/co2') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'2019-8'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Carbon dioxide [Partial pressure] in Arterial blood'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_2019_8"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/po2') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'2703-7'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Oxygen [Partial pressure] in Arterial blood'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_2703_7"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/base-excess') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'11555-0'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Base excess in Blood by calculation'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_11555_0"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/bicarbonate') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'1963-8'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Bicarbonate [Moles/volume] in Serum or Plasma'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_1963_8"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/sodium') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'2947-0'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Sodium [Moles/volume] in Blood'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_2947_0"</i><span style="color: navy">;</span>
abg.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/abg/potassium') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'2823-3'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Potassium [Moles/volume] in Serum or Plasma'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_2823_3"</i><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"arterialBloodGas"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">── The ventilator, as a second panel ─────────────────────────────────</span>
<span style="color: navy">// </span><span style="color: green">Together and not fifteen loose Observations: a setting only means</span>
<span style="color: navy">// </span><span style="color: green">something beside the others. A tidal volume of 400 mL is unremarkable at</span>
<span style="color: navy">// </span><span style="color: green">a rate of 12 and dangerous at a rate of 35.</span>
g.item<b> as </b><span style="color: maroon">v</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation') and item.answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetExamCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
v<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> v<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> v<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
v<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'20124-4'</span> <i>"cd"</i><span style="color: navy">;</span>
v<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Ventilation mode Ventilator'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
v<span style="color: navy"><b> -> </b></span>cc.text = <span style="color: blue">'Ventilator settings on the ICU observation chart'</span> <i>"codeText"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/mode') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'20124-4'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Ventilation mode Ventilator'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_20124_4"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/pressure-support') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'20079-0'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Pressure support setting Ventilator'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_20079_0"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/rate-set') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'19834-1'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Breath rate setting Ventilator'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_19834_1"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/rate-patient') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'9279-1'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Respiratory rate'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_9279_1"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/tidal-volume-set') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'20112-9'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Tidal volume setting Ventilator'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_20112_9"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/tidal-volume-actual') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-tidal-volume-actual'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Tidal volume actual'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_tidal_volume_actual"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/oxygen') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'3151-8'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Inhaled oxygen flow rate'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_3151_8"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/fio2') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'http://loinc.org'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'3150-0'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Inhaled oxygen concentration'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_3150_0"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/ie-ratio') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-inspiratory-to-expiratory-ratio'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Inspiratory to expiratory ratio'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_inspiratory_to_expiratory_ratio"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/trach-size') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-tracheostomy-tube-size'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Tracheostomy tube size'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_tracheostomy_tube_size"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/endo-tube-size') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-endotracheal-tube-size'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Endotracheal tube size'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_endotracheal_tube_size"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/assist-control') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-assist-control-in-use'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Assist control in use'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_assist_control_in_use"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/cuff-deflated') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-cuff-deflated'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Cuff deflated'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_cuff_deflated"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/spontaneous-breathing') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-breathing-spontaneously'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Breathing spontaneously'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_breathing_spontaneously"</i><span style="color: navy">;</span>
v.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/ventilation/weaning') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'ventilator-setting-weaning-from-the-ventilator'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Weaning from the ventilator'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_ventilator_setting_weaning_from_the_ventilator"</i><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"ventilatorSettings"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">── Nursing care done on the round ────────────────────────────────────</span>
<span style="color: navy">// </span><span style="color: green">Its own panel. Turning, suctioning and chest physiotherapy are what</span>
<span style="color: navy">// </span><span style="color: green">prevent the two complications this population dies of, and the chart is</span>
<span style="color: navy">// </span><span style="color: green">where they are evidenced.</span>
g.item<b> as </b><span style="color: maroon">c</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/care') and item.answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetProcedureCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
c<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> c<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> c<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
c<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-intensive-care-nursing-round'</span> <i>"cd"</i><span style="color: navy">;</span>
c<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Intensive care nursing round'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
c.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/care/nebulizer') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-nebuliser-given'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Nebuliser given'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_icu_care_nebuliser_given"</i><span style="color: navy">;</span>
c.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/care/physiotherapy') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-chest-physiotherapy-given'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Chest physiotherapy given'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_icu_care_chest_physiotherapy_given"</i><span style="color: navy">;</span>
c.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/care/suction') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-suctioned'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Suctioned'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_icu_care_suctioned"</i><span style="color: navy">;</span>
c.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/care/sigh') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-sighs-given'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Sighs given'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_icu_care_sighs_given"</i><span style="color: navy">;</span>
c.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/care/position') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span>obs.component<b> as </b><span style="color: maroon">comp</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>comp.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-position-of-the-patient'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Position of the patient'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>comp<b> then </b>SetComponentCodedValue<span style="color: navy">(</span><span style="color: maroon">it</span><span style="color: navy">, </span><span style="color: maroon">comp</span><span style="color: navy">)</span> <i>"value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"comp_icu_care_position_of_the_patient"</i><span style="color: navy">;</span>
g<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetRoundTime<span style="color: navy">(</span><span style="color: maroon">g</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"roundTime"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"nursingCare"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/remarks') and answer.value.exists()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> bundle.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy">, </span> entry.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">obs</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span> obs<span style="color: navy">, </span> entry<b> then </b>BuildObsBase<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"base"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetSurveyCategory<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"category"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>obs.code<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cc.coding<b> as </b><span style="color: maroon">cg</span><b> then</b><span style="color: navy"> {
</span> it<span style="color: navy"><b> -> </b></span>cg.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem'</span> <i>"sys"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.code = <span style="color: blue">'icu-care-remarks-on-an-intensive-care-round'</span> <i>"cd"</i><span style="color: navy">;</span>
it<span style="color: navy"><b> -> </b></span>cg.display = <span style="color: blue">'Remarks on an intensive care round'</span> <i>"dsp"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"code"</i><span style="color: navy">;</span>
it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">txt</span><span style="color: navy"><b> -> </b></span> obs.note<b> as </b><span style="color: maroon">n</span><span style="color: navy">, </span> n.text = <span style="color: maroon">txt</span> <i>"text"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"narr_icu_care_remarks_on_an_intensive_care_round"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"roundRows"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><span style="color: navy">// </span><span style="color: green">The round's own time, on every Observation from that round. A time and not a</span>
<span style="color: navy">// </span><span style="color: green">dateTime on the paper, so it rides as a note: the chart's columns are clock</span>
<span style="color: navy">// </span><span style="color: green">hours across a 24-hour sheet and the date comes from the response.</span>
<b>group </b>SetRoundTime<span style="color: navy">(</span><b>source</b> <span style="color: maroon">g</span>, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span> g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/time') and answer.value.exists()<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">t</span><span style="color: navy"><b> -> </b></span> obs.note<b> as </b><span style="color: maroon">n</span><span style="color: navy">, </span> n.text = <span style="color: blue">'Taken at the clock time recorded for this round on the chart'</span> <i>"timeNote"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"roundTimeRule"</i><span style="color: navy">;</span>
g.item<b> as </b><span style="color: maroon">it</span><b> where </b><span style="color: navy">(</span>(linkId = 'round/recorded-by') and answer.value.exists()<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">ref</span><span style="color: navy"><b> -> </b></span>obs.performer = <span style="color: maroon">ref</span> <i>"performer"</i><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"recordedByRule"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><span style="color: navy">// </span><span style="color: green">─────────────────────────────────────────────────────────────────────────────</span>
<span style="color: navy">// </span><span style="color: green">Shared scaffolding. Repeated in each map rather than imported: the transform</span>
<span style="color: navy">// </span><span style="color: green">engine resolves `imports` against whatever StructureMaps happen to be on the</span>
<span style="color: navy">// </span><span style="color: green">server, and a form that stops extracting because a shared map was not</span>
<span style="color: navy">// </span><span style="color: green">uploaded is a worse failure than a duplicated group.</span>
<span style="color: navy">// </span><span style="color: green">Two notes on what the publisher's StructureMap validator says about this file.</span>
<span style="color: navy">// </span><span style="color: green">Source parameters below are left untyped on purpose. Writing `: Element` makes</span>
<span style="color: navy">// </span><span style="color: green">the validator compare QuestionnaireResponse.item against the literal 'Element'</span>
<span style="color: navy">// </span><span style="color: green">and report them as incompatible with each other, which is noise, not a finding.</span>
<span style="color: navy">// </span><span style="color: green">`evaluate(context, expression)` is flagged as "takes 1 parameter but 2 were</span>
<span style="color: navy">// </span><span style="color: green">found". Leave it. The FML parser in the same jar refuses the one-argument form</span>
<span style="color: navy">// </span><span style="color: green">outright -- it wants a parameter, a comma, then the FHIRPath -- so the</span>
<span style="color: navy">// </span><span style="color: green">publisher is objecting to what its own compiler emits. Two arguments is the</span>
<span style="color: navy">// </span><span style="color: green">only form that compiles, and it is what the R5 transform engine executes.</span>
<span style="color: navy">// </span><span style="color: green">─────────────────────────────────────────────────────────────────────────────</span>
<b>group </b>BuildObsBase<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation, <b>target</b> <span style="color: maroon">entry</span><span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>obs<b> then </b>SetResponseProvenance<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">obs</span><span style="color: navy">)</span> <i>"responseProvenance"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> then </b>SetObservationFullUrl<span style="color: navy">(</span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>"idAndFullUrl"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>entry.request<b> as </b><span style="color: maroon">request</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>request.method = <span style="color: blue">'POST'</span> <i>"requestMethod"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>request.url = <span style="color: blue">'Observation'</span> <i>"requestUrl"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"entryRequest"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>obs.status = <span style="color: blue">'final'</span> <i>"status"</i><span style="color: navy">;</span>
qr.subject<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -> </b></span>obs.subject = <span style="color: maroon">s</span><span style="color: navy">;</span>
qr.encounter<b> as </b><span style="color: maroon">e</span><span style="color: navy"><b> -> </b></span>obs.encounter = <span style="color: maroon">e</span><span style="color: navy">;</span>
qr.authored<b> as </b><span style="color: maroon">t</span><span style="color: navy"><b> -> </b></span>obs.effective = <span style="color: maroon">t</span> <i>"effective"</i><span style="color: navy">;</span>
qr.source<b> as </b><span style="color: maroon">src</span><span style="color: navy"><b> -> </b></span>obs.performer = <span style="color: maroon">src</span> <i>"performerFromSource"</i><span style="color: navy">;</span>
qr<b> where </b><span style="color: navy">(</span>source.exists().not()<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span> qr.author<b> as </b><span style="color: maroon">a</span><span style="color: navy"><b> -> </b></span>obs.performer = <span style="color: maroon">a</span> <i>"performerFromAuthor"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"performerFallback"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">A stored response's id already reads "QuestionnaireResponse/<id>", so it is</span>
<span style="color: navy">// </span><span style="color: green">a relative reference as it stands. The hasValue() guard is what stops an</span>
<span style="color: navy">// </span><span style="color: green">unsaved response -- one posted straight to $extract rather than saved first</span>
<span style="color: navy">// </span><span style="color: green">-- from writing "QuestionnaireResponse/null" into the record.</span>
qr.id<b> as </b><span style="color: maroon">qid</span><b> where </b><span style="color: navy">(</span>$this.hasValue()<span style="color: navy">)</span><span style="color: navy"><b> -> </b></span> obs.derivedFrom = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Reference'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">ref</span><span style="color: navy">, </span> ref.reference = <span style="color: maroon">qid</span> <i>"linkQuestionnaireResponse"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetObservationFullUrl<span style="color: navy">(</span><b>source</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation, <b>target</b> <span style="color: maroon">entry</span><span style="color: navy">)</span><span style="color: navy"> {
</span> obs.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -> </b></span>entry.fullUrl = <b>append</b><span style="color: navy">(</span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/Observation/'</span><span style="color: navy">, </span><span style="color: maroon">id</span><span style="color: navy">)</span> <i>"assignFullUrl"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><span style="color: navy">// </span><span style="color: green">The two answer shapes a component can carry. Both read the answer through the</span>
<span style="color: navy">// </span><span style="color: green">untyped `.value` accessor: reading `valueCoding` or `valueQuantity` by its</span>
<span style="color: navy">// </span><span style="color: green">typed property name fails at transform time on HAPI R5 with "Attempt to read</span>
<span style="color: navy">// </span><span style="color: green">invalid property ... on QuestionnaireResponse.item.answer".</span>
<b>group </b>SetComponentCodedValue<span style="color: navy">(</span><b>source</b> <span style="color: maroon">it</span>, <b>target</b> <span style="color: maroon">comp</span><span style="color: navy">)</span><span style="color: navy"> {
</span> it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">cv</span><span style="color: navy"><b> -> </b></span>comp.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span> cv<span style="color: navy"><b> -> </b></span>cc.coding = <span style="color: maroon">cv</span> <i>"valueCoding"</i><span style="color: navy">;</span>
cv.display<b> as </b><span style="color: maroon">d</span><span style="color: navy"><b> -> </b></span>cc.text = <span style="color: maroon">d</span> <i>"valueText"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"codedValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"componentAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetComponentValue<span style="color: navy">(</span><b>source</b> <span style="color: maroon">it</span>, <b>target</b> <span style="color: maroon">comp</span><span style="color: navy">)</span><span style="color: navy"> {
</span> it.answer first<b> as </b><span style="color: maroon">a</span><b> then</b><span style="color: navy"> {
</span> a.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>comp.value = <span style="color: maroon">v</span> <i>"plainValue"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"componentAnswer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetSurveyCategory<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>obs.category<b> as </b><span style="color: maroon">cat</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>cat.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span> <i>"categorySystem"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.code = <span style="color: blue">'survey'</span> <i>"categoryCode"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.display = <span style="color: blue">'Survey'</span> <i>"categoryDisplay"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"categoryCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"category"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetVitalSignsCategory<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>obs.category<b> as </b><span style="color: maroon">cat</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>cat.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span> <i>"categorySystem"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.code = <span style="color: blue">'vital-signs'</span> <i>"categoryCode"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.display = <span style="color: blue">'Vital Signs'</span> <i>"categoryDisplay"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"categoryCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"category"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetLaboratoryCategory<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>obs.category<b> as </b><span style="color: maroon">cat</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>cat.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span> <i>"categorySystem"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.code = <span style="color: blue">'laboratory'</span> <i>"categoryCode"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.display = <span style="color: blue">'Laboratory'</span> <i>"categoryDisplay"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"categoryCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"category"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetExamCategory<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>obs.category<b> as </b><span style="color: maroon">cat</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>cat.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span> <i>"categorySystem"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.code = <span style="color: blue">'exam'</span> <i>"categoryCode"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.display = <span style="color: blue">'Exam'</span> <i>"categoryDisplay"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"categoryCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"category"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SetProcedureCategory<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>obs.category<b> as </b><span style="color: maroon">cat</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>cat.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>coding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span> <i>"categorySystem"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.code = <span style="color: blue">'procedure'</span> <i>"categoryCode"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>coding.display = <span style="color: blue">'Procedure'</span> <i>"categoryDisplay"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"categoryCoding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"category"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><span style="color: navy">// </span><span style="color: green">── Provenance and tenancy ───────────────────────────────────────────────────</span>
<span style="color: navy">// </span><span style="color: green">Two tags on everything this map creates. The first says which questionnaire</span>
<span style="color: navy">// </span><span style="color: green">produced it, so a form that reopens mid-admission recalls its own earlier</span>
<span style="color: navy">// </span><span style="color: green">entries and not another form's. The second copies the tenant tags off the</span>
<span style="color: navy">// </span><span style="color: green">response, because nothing else on the path puts them there.</span>
<span style="color: navy">// </span><span style="color: green">The code is the form's document type, not the questionnaire's id: every</span>
<span style="color: navy">// </span><span style="color: green">environment mints its own ids, and there is only one set of maps, so an id</span>
<span style="color: navy">// </span><span style="color: green">here would tie the tag to whichever environment stamped it.</span>
<span style="color: navy">// </span><span style="color: green">── Provenance and tenancy ───────────────────────────────────────────────────</span>
<b>group </b>SetResponseProvenance<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">r</span><span style="color: navy">)</span><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>r.meta<b> as </b><span style="color: maroon">m</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>m.tag<b> as </b><span style="color: maroon">t</span><b> then</b><span style="color: navy"> {
</span> qr<span style="color: navy"><b> -> </b></span>t.system = <span style="color: blue">'http://slade360edi.com/questionnaire-provenance'</span> <i>"provenanceSystem"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>t.code = <span style="color: blue">'icu-observation-chart'</span> <i>"provenanceCode"</i><span style="color: navy">;</span>
qr<span style="color: navy"><b> -> </b></span>t.display = <span style="color: blue">'ICU observation chart'</span> <i>"provenanceDisplay"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"provenanceTag"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"provenanceMeta"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">Every tag the response carries, onto the resource. `meta` is 0..1, so this</span>
<span style="color: navy">// </span><span style="color: green">lands on the same meta the rule above created rather than a second one.</span>
qr.meta<b> as </b><span style="color: maroon">qm</span><b> then</b><span style="color: navy"> {
</span> qm.tag<b> as </b><span style="color: maroon">qt</span><span style="color: navy"><b> -> </b></span> r.meta<b> as </b><span style="color: maroon">m</span><span style="color: navy">, </span> m.tag = <span style="color: maroon">qt</span> <i>"copyTag"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"tenantTags"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="https://fhir.slade360.co.ke/fhir/StructureMap/ExtractIcuObservationChart"/>
<version value="0.1.0"/>
<name value="ExtractIcuObservationChart"/>
<title value="ICU Observation Chart Extraction"/>
<status value="active"/>
<date value="2026-09-14T06:31:13+00:00"/>
<publisher value="Kathurima Kimathi"/>
<contact>
<name value="Kathurima Kimathi"/>
<telecom>
<system value="url"/>
<value value="https://www.linkedin.com/in/kathurima-kimathi/"/>
</telecom>
<telecom>
<system value="email"/>
<value value="kathurimakimathi415@gmail.com"/>
</telecom>
</contact>
<contact>
<name value="Oscar John"/>
<telecom>
<system value="email"/>
<value value="oscarjohnotieno@gmail.com"/>
<use value="work"/>
</telecom>
</contact>
<contact>
<name value="Kennedy Omondi"/>
<telecom>
<system value="email"/>
<value value="kennankole@gmail.com"/>
<use value="work"/>
</telecom>
</contact>
<description
value="Each round out as: the four vitals and the central venous pressure as their own Observations; the arterial blood gas as one panel with seven components, because a gas is interpreted whole and a pH of 7.25 means one thing beside a pCO2 of 8 and another beside a bicarbonate of 12; and the ventilator settings as a second panel. Every one takes the round's own time rather than the form's -- a deteriorating gas exchange is only visible as a series, and collapsing twenty-four rounds onto one instant would destroy it."/>
<structure>
<url
value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
<mode value="source"/>
<alias value="QR"/>
</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/Observation"/>
<mode value="target"/>
<alias value="Observation"/>
</structure>
<group>
<name value="ExtractIcuObservationChart"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="setBundleType"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="bundle"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="transaction"/>
</parameter>
</target>
</rule>
<rule>
<name value="unitGroup"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="g"/>
<condition value="linkId = 'unit'"/>
</source>
<rule>
<name value="measure_labour_stage_duration"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'unit/day-in-unit') and answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetSurveyCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="obs-day-in-unit"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Day in unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="set"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="obs"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="narr_11450_4"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'unit/diagnosis') and answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetSurveyCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="11450-4"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Problem list - Reported"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="codeText"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString value="Diagnosis on the ICU observation chart"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="text"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="txt"/>
</source>
<target>
<context value="obs"/>
<element value="note"/>
<variable value="n"/>
</target>
<target>
<context value="n"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="txt"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="narr_18776_5"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'unit/instructions') and answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetSurveyCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="18776-5"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Plan of care note"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="codeText"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString
value="Instructions on the ICU observation chart"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="text"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="txt"/>
</source>
<target>
<context value="obs"/>
<element value="note"/>
<variable value="n"/>
</target>
<target>
<context value="n"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="txt"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="roundRows"/>
<source>
<context value="qr"/>
<element value="item"/>
<variable value="g"/>
<condition value="linkId = 'round'"/>
</source>
<rule>
<name value="vital_8310_5"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/vitals/temperature') and answer.value.ofType(Quantity).exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetVitalSignsCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="8310-5"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Body temperature"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="obs"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="vital_8867_4"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/vitals/pulse') and answer.value.ofType(Quantity).exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetVitalSignsCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="8867-4"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Heart rate"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="obs"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="vital_9279_1"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/vitals/respiratory-rate') and answer.value.ofType(Quantity).exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetVitalSignsCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="9279-1"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Respiratory rate"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="obs"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="vital_60985_9"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/cvp') and answer.value.ofType(Quantity).exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetVitalSignsCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="60985-9"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Central venous pressure (CVP)"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="obs"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="roundBloodPressure"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/vitals/blood-pressure') and answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetVitalSignsCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="85354-9"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString
value="Blood pressure panel with all children optional"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="bpText"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="txt"/>
</source>
<target>
<context value="obs"/>
<element value="note"/>
<variable value="n"/>
</target>
<target>
<context value="n"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="txt"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<documentation
value="Blood pressure as typed. The chart is a graph with a systolic and a
diastolic plotted against each other; the digital form takes the pair as
one string rather than parsing it, because a mis-parsed blood pressure is
worse than a legible one."/>
</rule>
<rule>
<name value="arterialBloodGas"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="abg"/>
<condition
value="(linkId = 'round/abg') and item.answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetLaboratoryCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="abg"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="abg"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="abg"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="abg"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="24336-0"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="abg"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Gas panel - Arterial blood"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="comp_2744_1"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/ph') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="2744-1"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="pH of Arterial blood"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_2019_8"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/co2') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="2019-8"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString
value="Carbon dioxide [Partial pressure] in Arterial blood"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_2703_7"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/po2') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="2703-7"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString
value="Oxygen [Partial pressure] in Arterial blood"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_11555_0"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/base-excess') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="11555-0"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Base excess in Blood by calculation"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_1963_8"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/bicarbonate') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="1963-8"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString
value="Bicarbonate [Moles/volume] in Serum or Plasma"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_2947_0"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/sodium') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="2947-0"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Sodium [Moles/volume] in Blood"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_2823_3"/>
<source>
<context value="abg"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/abg/potassium') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="2823-3"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString
value="Potassium [Moles/volume] in Serum or Plasma"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<documentation
value="── The arterial blood gas, as one panel ──────────────────────────────"/>
</rule>
<rule>
<name value="ventilatorSettings"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="v"/>
<condition
value="(linkId = 'round/ventilation') and item.answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetExamCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="v"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="v"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="v"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="v"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="20124-4"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="v"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Ventilation mode Ventilator"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="codeText"/>
<source>
<context value="v"/>
</source>
<target>
<context value="cc"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString
value="Ventilator settings on the ICU observation chart"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="comp_20124_4"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/mode') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="20124-4"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Ventilation mode Ventilator"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_20079_0"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/pressure-support') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="20079-0"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Pressure support setting Ventilator"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_19834_1"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/rate-set') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="19834-1"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Breath rate setting Ventilator"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_9279_1"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/rate-patient') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="9279-1"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Respiratory rate"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_20112_9"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/tidal-volume-set') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="20112-9"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Tidal volume setting Ventilator"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_tidal_volume_actual"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/tidal-volume-actual') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-tidal-volume-actual"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Tidal volume actual"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_3151_8"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/oxygen') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="3151-8"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Inhaled oxygen flow rate"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_3150_0"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/fio2') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://loinc.org"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="3150-0"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Inhaled oxygen concentration"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name
value="comp_ventilator_setting_inspiratory_to_expiratory_ratio"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/ie-ratio') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-inspiratory-to-expiratory-ratio"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Inspiratory to expiratory ratio"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_tracheostomy_tube_size"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/trach-size') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-tracheostomy-tube-size"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Tracheostomy tube size"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_endotracheal_tube_size"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/endo-tube-size') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-endotracheal-tube-size"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Endotracheal tube size"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_assist_control_in_use"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/assist-control') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-assist-control-in-use"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Assist control in use"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_cuff_deflated"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/cuff-deflated') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="ventilator-setting-cuff-deflated"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Cuff deflated"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_breathing_spontaneously"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/spontaneous-breathing') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-breathing-spontaneously"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Breathing spontaneously"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_ventilator_setting_weaning_from_the_ventilator"/>
<source>
<context value="v"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/ventilation/weaning') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ventilator-setting-weaning-from-the-ventilator"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Weaning from the ventilator"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<documentation
value="── The ventilator, as a second panel ─────────────────────────────────
Together and not fifteen loose Observations: a setting only means
something beside the others. A tidal volume of 400 mL is unremarkable at
a rate of 12 and dangerous at a rate of 35."/>
</rule>
<rule>
<name value="nursingCare"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="c"/>
<condition
value="(linkId = 'round/care') and item.answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetProcedureCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="c"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="c"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="c"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="c"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-care-intensive-care-nursing-round"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="c"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Intensive care nursing round"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="comp_icu_care_nebuliser_given"/>
<source>
<context value="c"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/care/nebulizer') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-care-nebuliser-given"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Nebuliser given"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_icu_care_chest_physiotherapy_given"/>
<source>
<context value="c"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/care/physiotherapy') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-care-chest-physiotherapy-given"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Chest physiotherapy given"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_icu_care_suctioned"/>
<source>
<context value="c"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/care/suction') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-care-suctioned"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Suctioned"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_icu_care_sighs_given"/>
<source>
<context value="c"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/care/sigh') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-care-sighs-given"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Sighs given"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="comp_icu_care_position_of_the_patient"/>
<source>
<context value="c"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/care/position') and answer.value.exists()"/>
</source>
<target>
<context value="obs"/>
<element value="component"/>
<variable value="comp"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-care-position-of-the-patient"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Position of the patient"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="it"/>
</source>
<target>
<context value="comp"/>
</target>
<dependent>
<name value="SetComponentCodedValue"/>
<parameter>
<valueId value="it"/>
</parameter>
<parameter>
<valueId value="comp"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="roundTime"/>
<source>
<context value="g"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetRoundTime"/>
<parameter>
<valueId value="g"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<documentation
value="── Nursing care done on the round ────────────────────────────────────
Its own panel. Turning, suctioning and chest physiotherapy are what
prevent the two complications this population dies of, and the chart is
where they are evidenced."/>
</rule>
<rule>
<name value="narr_icu_care_remarks_on_an_intensive_care_round"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/remarks') and answer.value.exists()"/>
</source>
<target>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</target>
<target>
<context value="entry"/>
<element value="resource"/>
<variable value="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<rule>
<name value="base"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<target>
<context value="entry"/>
</target>
<dependent>
<name value="BuildObsBase"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetSurveyCategory"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="code"/>
<source>
<context value="it"/>
</source>
<target>
<context value="obs"/>
<element value="code"/>
<variable value="cc"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<variable value="cg"/>
</target>
<rule>
<name value="sys"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/concept-codesystem"/>
</parameter>
</target>
</rule>
<rule>
<name value="cd"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="icu-care-remarks-on-an-intensive-care-round"/>
</parameter>
</target>
</rule>
<rule>
<name value="dsp"/>
<source>
<context value="it"/>
</source>
<target>
<context value="cg"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Remarks on an intensive care round"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="text"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="txt"/>
</source>
<target>
<context value="obs"/>
<element value="note"/>
<variable value="n"/>
</target>
<target>
<context value="n"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="txt"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<documentation
value="── One round ───────────────────────────────────────────────────────────"/>
</rule>
</group>
<group>
<name value="SetRoundTime"/>
<documentation
value="The round's own time, on every Observation from that round. A time and not a
dateTime on the paper, so it rides as a note: the chart's columns are clock
hours across a 24-hour sheet and the date comes from the response."/>
<input>
<name value="g"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="roundTimeRule"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition value="(linkId = 'round/time') and answer.value.exists()"/>
</source>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="timeNote"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="t"/>
</source>
<target>
<context value="obs"/>
<element value="note"/>
<variable value="n"/>
</target>
<target>
<context value="n"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString
value="Taken at the clock time recorded for this round on the chart"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="recordedByRule"/>
<source>
<context value="g"/>
<element value="item"/>
<variable value="it"/>
<condition
value="(linkId = 'round/recorded-by') and answer.value.exists()"/>
</source>
<rule>
<name value="answer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="performer"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="ref"/>
</source>
<target>
<context value="obs"/>
<element value="performer"/>
<transform value="copy"/>
<parameter>
<valueId value="ref"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="BuildObsBase"/>
<documentation
value="─────────────────────────────────────────────────────────────────────────────
Shared scaffolding. Repeated in each map rather than imported: the transform
engine resolves `imports` against whatever StructureMaps happen to be on the
server, and a form that stops extracting because a shared map was not
uploaded is a worse failure than a duplicated group.
Two notes on what the publisher's StructureMap validator says about this file.
Source parameters below are left untyped on purpose. Writing `: Element` makes
the validator compare QuestionnaireResponse.item against the literal 'Element'
and report them as incompatible with each other, which is noise, not a finding.
`evaluate(context, expression)` is flagged as "takes 1 parameter but 2 were
found". Leave it. The FML parser in the same jar refuses the one-argument form
outright -- it wants a parameter, a comma, then the FHIRPath -- so the
publisher is objecting to what its own compiler emits. Two arguments is the
only form that compiles, and it is what the R5 transform engine executes.
─────────────────────────────────────────────────────────────────────────────"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<input>
<name value="entry"/>
<mode value="target"/>
</input>
<rule>
<name value="responseProvenance"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
</target>
<dependent>
<name value="SetResponseProvenance"/>
<parameter>
<valueId value="qr"/>
</parameter>
<parameter>
<valueId value="obs"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="idAndFullUrl"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="id"/>
<transform value="uuid"/>
</target>
<dependent>
<name value="SetObservationFullUrl"/>
<parameter>
<valueId value="obs"/>
</parameter>
<parameter>
<valueId value="entry"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="entryRequest"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="entry"/>
<element value="request"/>
<variable value="request"/>
</target>
<rule>
<name value="requestMethod"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="request"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
</rule>
<rule>
<name value="requestUrl"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="request"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="status"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="subject"/>
<source>
<context value="qr"/>
<element value="subject"/>
<variable value="s"/>
</source>
<target>
<context value="obs"/>
<element value="subject"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
<rule>
<name value="encounter"/>
<source>
<context value="qr"/>
<element value="encounter"/>
<variable value="e"/>
</source>
<target>
<context value="obs"/>
<element value="encounter"/>
<transform value="copy"/>
<parameter>
<valueId value="e"/>
</parameter>
</target>
</rule>
<rule>
<name value="effective"/>
<source>
<context value="qr"/>
<element value="authored"/>
<variable value="t"/>
</source>
<target>
<context value="obs"/>
<element value="effective"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
<rule>
<name value="performerFromSource"/>
<source>
<context value="qr"/>
<element value="source"/>
<variable value="src"/>
</source>
<target>
<context value="obs"/>
<element value="performer"/>
<transform value="copy"/>
<parameter>
<valueId value="src"/>
</parameter>
</target>
</rule>
<rule>
<name value="performerFallback"/>
<source>
<context value="qr"/>
<condition value="source.exists().not()"/>
</source>
<rule>
<name value="performerFromAuthor"/>
<source>
<context value="qr"/>
<element value="author"/>
<variable value="a"/>
</source>
<target>
<context value="obs"/>
<element value="performer"/>
<transform value="copy"/>
<parameter>
<valueId value="a"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="linkQuestionnaireResponse"/>
<source>
<context value="qr"/>
<element value="id"/>
<variable value="qid"/>
<condition value="$this.hasValue()"/>
</source>
<target>
<context value="obs"/>
<element value="derivedFrom"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueId value="qid"/>
</parameter>
</target>
<documentation
value="A stored response's id already reads "QuestionnaireResponse/<id>", so it is
a relative reference as it stands. The hasValue() guard is what stops an
unsaved response -- one posted straight to $extract rather than saved first
-- from writing "QuestionnaireResponse/null" into the record."/>
</rule>
</group>
<group>
<name value="SetObservationFullUrl"/>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="source"/>
</input>
<input>
<name value="entry"/>
<mode value="target"/>
</input>
<rule>
<name value="assignFullUrl"/>
<source>
<context value="obs"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="entry"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://fhir.slade360.co.ke/fhir/Observation/"/>
</parameter>
<parameter>
<valueId value="id"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="SetComponentCodedValue"/>
<documentation
value="The two answer shapes a component can carry. Both read the answer through the
untyped `.value` accessor: reading `valueCoding` or `valueQuantity` by its
typed property name fails at transform time on HAPI R5 with "Attempt to read
invalid property ... on QuestionnaireResponse.item.answer"."/>
<input>
<name value="it"/>
<mode value="source"/>
</input>
<input>
<name value="comp"/>
<mode value="target"/>
</input>
<rule>
<name value="componentAnswer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="codedValue"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="cv"/>
</source>
<target>
<context value="comp"/>
<element value="value"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="valueCoding"/>
<source>
<context value="cv"/>
</source>
<target>
<context value="cc"/>
<element value="coding"/>
<transform value="copy"/>
<parameter>
<valueId value="cv"/>
</parameter>
</target>
</rule>
<rule>
<name value="valueText"/>
<source>
<context value="cv"/>
<element value="display"/>
<variable value="d"/>
</source>
<target>
<context value="cc"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="d"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="SetComponentValue"/>
<input>
<name value="it"/>
<mode value="source"/>
</input>
<input>
<name value="comp"/>
<mode value="target"/>
</input>
<rule>
<name value="componentAnswer"/>
<source>
<context value="it"/>
<element value="answer"/>
<listMode value="first"/>
<variable value="a"/>
</source>
<rule>
<name value="plainValue"/>
<source>
<context value="a"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="comp"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="SetSurveyCategory"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="category"/>
<variable value="cat"/>
</target>
<rule>
<name value="categoryCoding"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="cat"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="categorySystem"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryCode"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="survey"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryDisplay"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Survey"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="SetVitalSignsCategory"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="category"/>
<variable value="cat"/>
</target>
<rule>
<name value="categoryCoding"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="cat"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="categorySystem"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryCode"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="vital-signs"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryDisplay"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Vital Signs"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="SetLaboratoryCategory"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="category"/>
<variable value="cat"/>
</target>
<rule>
<name value="categoryCoding"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="cat"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="categorySystem"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryCode"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="laboratory"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryDisplay"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Laboratory"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="SetExamCategory"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="category"/>
<variable value="cat"/>
</target>
<rule>
<name value="categoryCoding"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="cat"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="categorySystem"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryCode"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="exam"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryDisplay"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Exam"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="SetProcedureCategory"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="category"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="obs"/>
<element value="category"/>
<variable value="cat"/>
</target>
<rule>
<name value="categoryCoding"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="cat"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="categorySystem"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryCode"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="procedure"/>
</parameter>
</target>
</rule>
<rule>
<name value="categoryDisplay"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="coding"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Procedure"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="SetResponseProvenance"/>
<documentation
value="── Provenance and tenancy ───────────────────────────────────────────────────
Two tags on everything this map creates. The first says which questionnaire
produced it, so a form that reopens mid-admission recalls its own earlier
entries and not another form's. The second copies the tenant tags off the
response, because nothing else on the path puts them there.
The code is the form's document type, not the questionnaire's id: every
environment mints its own ids, and there is only one set of maps, so an id
here would tie the tag to whichever environment stamped it.
── Provenance and tenancy ───────────────────────────────────────────────────"/>
<input>
<name value="qr"/>
<type value="QR"/>
<mode value="source"/>
</input>
<input>
<name value="r"/>
<mode value="target"/>
</input>
<rule>
<name value="provenanceMeta"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="r"/>
<element value="meta"/>
<variable value="m"/>
</target>
<rule>
<name value="provenanceTag"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="m"/>
<element value="tag"/>
<variable value="t"/>
</target>
<rule>
<name value="provenanceSystem"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="t"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://slade360edi.com/questionnaire-provenance"/>
</parameter>
</target>
</rule>
<rule>
<name value="provenanceCode"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="t"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="icu-observation-chart"/>
</parameter>
</target>
</rule>
<rule>
<name value="provenanceDisplay"/>
<source>
<context value="qr"/>
</source>
<target>
<context value="t"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="ICU observation chart"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="tenantTags"/>
<source>
<context value="qr"/>
<element value="meta"/>
<variable value="qm"/>
</source>
<rule>
<name value="copyTag"/>
<source>
<context value="qm"/>
<element value="tag"/>
<variable value="qt"/>
</source>
<target>
<context value="r"/>
<element value="meta"/>
<variable value="m"/>
</target>
<target>
<context value="m"/>
<element value="tag"/>
<transform value="copy"/>
<parameter>
<valueId value="qt"/>
</parameter>
</target>
</rule>
<documentation
value="Every tag the response carries, onto the resource. `meta` is 0..1, so this
lands on the same meta the rule above created rather than a second one."/>
</rule>
</group>
</StructureMap>