Id: AdverseEvents Url: Adverse Event Logic Version: 0.1.0 Name: AdverseEvents Title: Adverse Event Logic Status: draft Date: 2026-02-19 22:08:15+0000 Publisher: Oregon Health and Science University Description: Decision logic for identifying recent adverse reactions that may be related to hypertension medications 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 AdverseEventOutcome Parameters: Name Type Min Max In/Out Patient Patient 0 1 Out Untreated Recommendation string 0 1 Out Untreated Rationale string 0 1 Out Adverse Events AdverseEvent 0 * Out Untreated Adverse Events AdverseEvent 0 * Out Untreated Suggestions string 0 1 Out Selection Behavior string 0 1 Out Links string 0 1 Out Untreated Rationale Combined Data string 0 1 Out Untreated Indicator Status string 0 1 Out Treated Indicator Status string 0 1 Out Treated Recommendation string 0 1 Out Treated Adverse Events AdverseEvent 0 * Out Treated Rationale string 0 1 Out Treated Suggestions string 0 1 Out Treated Rationale Combined Data string 0 1 Out Untreated Adverse Events Action Path boolean 0 1 Out Treated Adverse Events Action Path boolean 0 1 Out Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/StructureDefinition/Patient AdverseEvent http://hl7.org/fhir/StructureDefinition/AdverseEvent ;;; Content: text/cql library AdverseEvents 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; codesystem &quot;AdverseEventOutcomeCodeSystem&quot;: 'http://terminology.hl7.org/CodeSystem/adverse-event-outcome'#xD; code &quot;ongoing&quot;: 'ongoing' from &quot;AdverseEventOutcomeCodeSystem&quot; display 'Ongoing'#xD; code &quot;resolved&quot;: 'resolved' from &quot;AdverseEventOutcomeCodeSystem&quot; display 'Resolved'#xD; #xD; context Patient#xD; #xD; define function &quot;AE Event Display&quot;(codes List&lt;FHIR.Coding&gt;):#xD; First(codes C where C.code != 'coach-adverse-event').display#xD; #xD; define function &quot;AE Suggestion String&quot;(aes List&lt;FHIR.AdverseEvent&gt;):#xD; aes AE return '{&quot;id&quot;: &quot;' + AE.id + '&quot;, &quot;type&quot;: &quot;adverse-event&quot;, &quot;label&quot;: &quot;' + &quot;AE Event Display&quot;(AE.event.coding) + '&quot;}'#xD; #xD; define function &quot;Contact Suggestion String&quot;(aes List&lt;FHIR.AdverseEvent&gt;):#xD; aes AE return &quot;AE Event Display&quot;(AE.event.coding)#xD; #xD; define &quot;Untreated Recommendation&quot;:#xD; 'Report Side Effect'#xD; #xD; define &quot;Untreated Rationale Combined Data&quot;:#xD; &quot;Untreated Rationale&quot; + '|' + &quot;Untreated Suggestions&quot; + '|' + &quot;Selection Behavior&quot; + '|' + &quot;Links&quot;#xD; #xD; define &quot;Untreated Rationale&quot;:#xD; 'A side effect can be any undesirable outcome that results from blood pressure management. You recently had a condition that may be a side effect. If you are currently experiencing ongoing symptoms, we strongly recommend reaching out to your primary care provider.'#xD; #xD; define &quot;Untreated Suggestions&quot;:#xD; '[{ &quot;id&quot;: &quot;contact-suggestion&quot;, &quot;label&quot;: &quot;Contact care team&quot;, &quot;type&quot;: &quot;suggestion-link&quot;, &quot;actions&quot;: [{&quot;label&quot;:&quot;Contact your care team if you are currently experiencing a side effect&quot; , &quot;url&quot;:&quot;/contact?token=untreated-adverse-event&quot;}] },' +#xD; Combine(&quot;AE Suggestion String&quot;(&quot;Untreated Adverse Events&quot;), ',') +#xD; ']'#xD; #xD; define &quot;Untreated Indicator Status&quot;:#xD; 'critical'#xD; #xD; define &quot;Treated Indicator Status&quot;:#xD; 'warning'#xD; #xD; define &quot;Selection Behavior&quot;:#xD; 'at-most-one'#xD; #xD; define &quot;Links&quot;:#xD; ''#xD; #xD; define &quot;Treated Recommendation&quot;:#xD; 'See care team and discuss treatment if event recurs'#xD; #xD; define &quot;Treated Rationale Combined Data&quot;:#xD; &quot;Treated Rationale&quot; + '|' + &quot;Treated Suggestions&quot; + '|' + &quot;Selection Behavior&quot; + '|' + &quot;Links&quot;#xD; #xD; define &quot;Treated Rationale&quot;:#xD; 'A side effect associated with blood pressure management has been detected and addressed: &lt;strong&gt;' + Combine(&quot;Contact Suggestion String&quot;(&quot;Treated Adverse Events&quot;), ', ') + '&lt;/strong&gt;. If event recurs, adjustment to medication and/or blood pressure goal may be required. This message may remain for up to 30 days as a reminder to continue monitoring this condition.'#xD; #xD; define &quot;Treated Suggestions&quot;:#xD; '[]'#xD; #xD; // Only get the adverse events coded from the application#xD; define &quot;Adverse Events&quot;:#xD; [AdverseEvent] AE where AE.event.coding.code contains 'coach-adverse-event'#xD; #xD; define &quot;Treated Adverse Events&quot;:#xD; &quot;Adverse Events&quot; AE where AE.outcome ~ &quot;resolved&quot;#xD; #xD; define &quot;Untreated Adverse Events&quot;:#xD; &quot;Adverse Events&quot; AE where AE.outcome ~ &quot;ongoing&quot;#xD; #xD; define &quot;Untreated Adverse Events Action Path&quot;:#xD; exists &quot;Untreated Adverse Events&quot;#xD; #xD; define &quot;Treated Adverse Events Action Path&quot;:#xD; exists &quot;Treated Adverse Events&quot;#xD; Content: application/elm+xml Encoded data (61360 characters) Content: application/elm+json Encoded data (107292 characters)
Decision logic for identifying recent adverse reactions that may be related to hypertension medications
Published by OHSU under an Apache 2.0 License
Code system AdverseEventOutcomeCodeSystem