Id: HypertensiveEmergency Url: Very High Blood Pressure Alert Logic Version: 0.1.0 Name: HypertensiveEmergency Title: Very High Blood Pressure Alert Logic Status: draft Date: 2026-02-19 22:08:15+0000 Publisher: Oregon Health and Science University Description: Decision logic for identifying a recent very high blood pressure Jurisdiction: 840 Copyright: Published by OHSU under an Apache 2.0 License Related Artifacts: Type Resource depends-on http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1 depends-on http://fhir.org/guides/ohsuhypertensionig/Library/FHIRHelpers|4.0.1 depends-on Common Logicversion: null0.1.0) depends-on Systolic blood pressure depends-on Diastolic Blood Pressure depends-on Blood Pressure Measured Parameters: Name Type Min Max In/Out Patient Patient 0 1 Out BP Observation Count integer 0 1 Out Next Most Recent BP Reading Resource 0 1 Out Two Low BPs boolean 0 1 Out In Population boolean 0 1 Out Two High BPs boolean 0 1 Out Recommendation string 0 1 Out Rationale string 0 1 Out Suggestions string 0 1 Out Selection Behavior string 0 1 Out Links string 0 1 Out Rationale Combined Data string 0 1 Out Indicator Status string 0 1 Out TEST Most Recent BP Reading Resource 0 1 Out TEST Next Most Recent BP Reading Resource 0 1 Out TEST Two High BPs boolean 0 1 Out TEST Two Low BPs boolean 0 1 Out TEST One Low BP boolean 0 1 Out Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/StructureDefinition/Patient Observation http://hl7.org/fhir/StructureDefinition/Observation ; Content: text/cql library HypertensiveEmergency version '0.1'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include FHIRHelpers version '4.0.1' called FHIRHelpers#xD; include OHSUHTNCommon version '0.1' called Common#xD; #xD; context Patient#xD; #xD; define function &quot;BP Within 14 Days&quot;(O Tuple { id String, effective DateTime, systolic Decimal, diastolic Decimal, readingType String }):#xD; O.effective + 14 days &gt;= Today()#xD; #xD; // Two Low BPs are handled through an adverse event creation#xD; define &quot;In Population&quot;:#xD; Common.&quot;HTN Crisis&quot; and not &quot;Two Low BPs&quot;#xD; #xD; define &quot;BP Observation Count&quot;:#xD; Count(Common.&quot;All BP Observations&quot; O)#xD; #xD; define &quot;Next Most Recent BP Reading&quot;:#xD; if &quot;BP Observation Count&quot; &gt; 1 then (Common.&quot;All BP Observations&quot; O sort by effective)[&quot;BP Observation Count&quot;-2]#xD; else null#xD; #xD; define &quot;Two High BPs&quot;:#xD; Common.&quot;HTN High Crisis&quot; and &quot;BP Within 14 Days&quot;(Common.&quot;Most Recent BP Reading&quot;) and #xD; &quot;BP Within 14 Days&quot;(&quot;Next Most Recent BP Reading&quot;) and Common.&quot;HTN Crisis BP&quot;(&quot;Next Most Recent BP Reading&quot;)#xD; #xD; define &quot;Two Low BPs&quot;:#xD; Common.&quot;HTN Low Crisis&quot; and &quot;BP Within 14 Days&quot;(Common.&quot;Most Recent BP Reading&quot;) and #xD; &quot;BP Within 14 Days&quot;(&quot;Next Most Recent BP Reading&quot;) and Common.&quot;HTN Low Crisis BP&quot;(&quot;Next Most Recent BP Reading&quot;)#xD; #xD; define &quot;Recommendation&quot;:#xD; 'Blank.Summary'#xD; #xD; define &quot;Rationale Combined Data&quot;:#xD; &quot;Rationale&quot; + '|' + &quot;Suggestions&quot; + '|' + &quot;Selection Behavior&quot; + '|' + &quot;Links&quot;#xD; #xD; define &quot;Rationale&quot;:#xD; if &quot;Two High BPs&quot; then 'Your last two BP readings &gt;=180 mmHg systolic and/or &gt;=120 mmHg diastolic) are very high. &lt;strong&gt;If you &lt;a href=&quot;/resources/symptoms-911&quot;&gt;do not feel well&lt;/a&gt;, call 911; otherwise, it is strongly recommended that you now contact your clinic.&lt;/strong&gt;'#xD; else if Common.&quot;HTN High Crisis&quot; then 'Remain calm and check your BP again following these &lt;a href=&quot;/vitals#instructions&quot;&gt;instructions&lt;/a&gt; in 5 to 30 minutes. Read more about managing very high blood pressure in the link below.'#xD; else if Common.&quot;HTN Low Crisis&quot; then 'Remain calm and check your BP again following these &lt;a href=&quot;/vitals#instructions&quot;&gt;instructions&lt;/a&gt; in 5 to 30 minutes. Read more about symptoms from low blood pressure in the link below.'#xD; else null#xD; #xD; define &quot;Indicator Status&quot;:#xD; if &quot;Two High BPs&quot; then 'critical'#xD; else if &quot;In Population&quot; then 'critical'#xD; else null#xD; #xD; define &quot;Suggestions&quot;:#xD; if &quot;Two High BPs&quot; then '[{&quot;id&quot;: &quot;display-clinic-contact&quot;, &quot;label&quot;: &quot;&quot;, &quot;type&quot;: &quot;clinic-contact&quot;}]'#xD; else if Common.&quot;HTN Crisis&quot; then '[ { &quot;id&quot;: &quot;enter-bp-suggestion&quot;, &quot;label&quot;: &quot;Enter Blood Pressure&quot;, &quot;type&quot;: &quot;suggestion-link&quot;, &quot;actions&quot;: [{&quot;label&quot;:&quot;Check your BP again (strongly recommended)&quot;, &quot;url&quot;:&quot;/vitals&quot;}] } ]'#xD; else null#xD; #xD; define &quot;Selection Behavior&quot;:#xD; 'at-most-one'#xD; #xD; define &quot;Links&quot;:#xD; if &quot;Two High BPs&quot; or Common.&quot;HTN High Crisis&quot; then '[{&quot;label&quot;:&quot;American Heart Association: When to call 911 for high blood pressure&quot;, &quot;url&quot;:&quot;https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings/hypertensive-crisis-when-you-should-call-911-for-high-blood-pressure&quot;}]'#xD; else if Common.&quot;HTN Low Crisis&quot; then '[{&quot;label&quot;:&quot;American Heart Association: When Blood Pressure is too Low&quot;, &quot;url&quot;:&quot;https://www.heart.org/en/health-topics/high-blood-pressure/the-facts-about-high-blood-pressure/low-blood-pressure-when-blood-pressure-is-too-low&quot;}]'#xD; else null#xD; #xD; define &quot;TEST Most Recent BP Reading&quot;:#xD; Common.&quot;Most Recent BP Reading&quot;#xD; #xD; define &quot;TEST Next Most Recent BP Reading&quot;:#xD; &quot;Next Most Recent BP Reading&quot;#xD; #xD; define &quot;TEST Two High BPs&quot;:#xD; &quot;Two High BPs&quot;#xD; #xD; define &quot;TEST Two Low BPs&quot;:#xD; &quot;Two Low BPs&quot;#xD; #xD; define &quot;TEST One Low BP&quot;:#xD; Common.&quot;HTN Low Crisis&quot;#xD; #xD; Content: application/elm+xml Encoded data (56984 characters) Content: application/elm+json Encoded data (98792 characters)
Decision logic for identifying a recent very high blood pressure
Published by OHSU under an Apache 2.0 License