<?xml version="1.0" encoding="UTF-8"?>

<PlanDefinition xmlns="http://hl7.org/fhir">
  <id value="rmd-sully-rule2"/>
  <meta>
    <profile value="http://resmed.com/fhir/core/StructureDefinition/rmd-rule-plandefinition"/>
  </meta>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative: PlanDefinition</b><a name="rmd-sully-rule2"> </a></p><div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource PlanDefinition &quot;rmd-sully-rule2&quot; </p><p style="margin-bottom: 0px">Profile: <a href="StructureDefinition-rmd-rule-plandefinition.html">ResMed Rule Instance PlanDefinition</a></p></div><p><b>url</b>: <code>http://resmed.com/fhir/core/PlanDefinition/rmd-sully-rule2</code></p><p><b>version</b>: 0.37.0</p><p><b>name</b>: SpontTriggerOverPctofMedianforConsecutiveDays</p><p><b>type</b>: Rule Instance <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="CodeSystem-resmed-plandefinition-type-identifier-code-system.html">ResMed Plan Definition Type Identifier CodeSystem</a>#rule)</span></p><p><b>status</b>: active</p><p><b>date</b>: 2024-01-11 18:32:48+0000</p><p><b>publisher</b>: ResMed Corp</p><p><b>contact</b>: ResMed Corp: <a href="https://www.resmed.com">https://www.resmed.com</a>,<a href="mailto:atomteam-halifax@resmed.com">atomteam-halifax@resmed.com</a></p><h3>UseContexts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Code</b></td><td><b>Value[x]</b></td></tr><tr><td style="display: none">*</td><td>Program (Details: http://terminology.hl7.org/CodeSystem/usage-context-type code program = 'Program', stated as 'null')</td><td>airview-compliance-engine <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="CodeSystem-resmed-rule-implementer-identifier-code-system.html">ResMed Rule Implementer Identifier CodeSystem</a>#ACE)</span></td></tr></table><p><b>jurisdiction</b>: Global (Whole world) <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (m49.htm#001)</span></p><blockquote><p><b>action</b></p><blockquote><p><b>trigger</b></p><p><b>type</b>: data-added</p><blockquote><p><b>data</b></p><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/observation.html">Observation</a></td></tr></table></blockquote><blockquote><p><b>condition</b></p><p><span title="application/x.rmd-ace+json"><code>{
          &quot;name&quot;: &quot;SpontTriggerOverPctofMedianforConsecutiveDays&quot;,
          &quot;ruleId&quot;: &quot;0782bc2d-8c14-424d-ae13-5625a7f80d00&quot;,
          &quot;operator&quot;: &quot;&lt;&quot;,
          &quot;threshold&quot;: 4,
          &quot;enabled&quot;: false,
          &quot;alertName&quot;: &quot;SpontTrigger_Median_Abnormal&quot;,
          &quot;days&quot;: 2,
          &quot;custom&quot;: [],
          &quot;calculatedMedian&quot;: {
            &quot;value&quot;: 1.01,
            &quot;endDay&quot;: &quot;2022-06-06&quot;,
            &quot;startDay&quot;: &quot;2022-06-06&quot;,
            &quot;validDays&quot;: 5
          },
          &quot;isMedianRule&quot;: true
        }</code></span></p></blockquote></blockquote></blockquote></div>
  </text>
  <url value="http://resmed.com/fhir/core/PlanDefinition/rmd-sully-rule2"/>
  <version value="0.37.0"/>
  <name value="SpontTriggerOverPctofMedianforConsecutiveDays"/>
  <type>
    <coding>
      <system value="http://terminology.resmed.com/CodeSystem/resmed-plandefinition-type-identifier"/>
      <code value="rule"/>
    </coding>
  </type>
  <status value="active"/>
  <date value="2024-01-11T18:32:48+00:00"/>
  <publisher value="ResMed Corp"/>
  <contact>
    <name value="ResMed Corp"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.resmed.com"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="atomteam-halifax@resmed.com"/>
    </telecom>
  </contact>
  <useContext>
    <code>
      <system value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
      <code value="program"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <system value="http://terminology.resmed.com/CodeSystem/resmed-rule-implementer-identifier"/>
        <code value="ACE"/>
      </coding>
    </valueCodeableConcept>
  </useContext>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
    </coding>
  </jurisdiction>
  <action>
    <trigger>
      <type value="data-added"/>
      <data>
        <type value="Observation"/>
      </data>
      <condition>
        <language value="application/x.rmd-ace+json"/>
        <expression value="{&#xA;          &quot;name&quot;: &quot;SpontTriggerOverPctofMedianforConsecutiveDays&quot;,&#xA;          &quot;ruleId&quot;: &quot;0782bc2d-8c14-424d-ae13-5625a7f80d00&quot;,&#xA;          &quot;operator&quot;: &quot;&lt;&quot;,&#xA;          &quot;threshold&quot;: 4,&#xA;          &quot;enabled&quot;: false,&#xA;          &quot;alertName&quot;: &quot;SpontTrigger_Median_Abnormal&quot;,&#xA;          &quot;days&quot;: 2,&#xA;          &quot;custom&quot;: [],&#xA;          &quot;calculatedMedian&quot;: {&#xA;            &quot;value&quot;: 1.01,&#xA;            &quot;endDay&quot;: &quot;2022-06-06&quot;,&#xA;            &quot;startDay&quot;: &quot;2022-06-06&quot;,&#xA;            &quot;validDays&quot;: 5&#xA;          },&#xA;          &quot;isMedianRule&quot;: true&#xA;        }"/>
      </condition>
    </trigger>
  </action>
</PlanDefinition>