OHSU Hypertension Implementation Guide
0.1.0 - CI Build Unknown region code '840'

OHSU Hypertension Implementation Guide, published by Oregon Health and Science University. 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/OHSUCMP/htnu18ig/ and changes regularly. See the Directory of published versions

Library: Adverse Event Logic

Official URL: http://fhir.org/guides/ohsuhypertensionig/Library/AdverseEvents Version: 0.1.0
Draft as of 2026-04-24 Computable Name: AdverseEvents

Copyright/Legal: Published by OHSU under an Apache 2.0 License

Decision logic for identifying recent adverse reactions that may be related to hypertension medications

Metadata
Title Adverse Event Logic
Version 0.1.0
Status Draft
Jurisdiction 840 from http://unstats.un.org/unsd/methods/m49/m49.htm
Steward (Publisher) Oregon Health and Science University
Steward Contact Oregon Health and Science University
Description

Decision logic for identifying recent adverse reactions that may be related to hypertension medications

Copyright

Published by OHSU under an Apache 2.0 License

Dependency Description: FHIR model information
Resource: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
Canonical URL: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
Dependency Description: Library FHIRHelpers
Resource: http://fhir.org/guides/ohsuhypertensionig/Library/FHIRHelpers|4.0.1
Canonical URL: http://fhir.org/guides/ohsuhypertensionig/Library/FHIRHelpers|4.0.1
Dependency Description: Library Common
Resource: Common Logic version: 0.1.0
Canonical URL: http://fhir.org/guides/ohsuhypertensionig/Library/OHSUHTNCommon|0.1
Dependency Description: Code system AdverseEventOutcomeCodeSystem
Resource: AdverseEventOutcome
Canonical URL: http://terminology.hl7.org/CodeSystem/adverse-event-outcome
Data Requirement Type: Patient
Profile(s): Patient
Data Requirement Type: AdverseEvent
Profile(s): AdverseEvent
Must Support Elements: event, event.coding, outcome
Parameters
Name Use Card. Type Documentation
Patient Out 0..1 Patient
Untreated Recommendation Out 0..1 string
Untreated Rationale Out 0..1 string
Adverse Events Out 0..* AdverseEvent
Untreated Adverse Events Out 0..* AdverseEvent
Untreated Suggestions Out 0..1 string
Selection Behavior Out 0..1 string
Links Out 0..1 string
Untreated Rationale Combined Data Out 0..1 string
Untreated Indicator Status Out 0..1 string
Treated Indicator Status Out 0..1 string
Treated Recommendation Out 0..1 string
Treated Adverse Events Out 0..* AdverseEvent
Treated Rationale Out 0..1 string
Treated Suggestions Out 0..1 string
Treated Rationale Combined Data Out 0..1 string
Untreated Adverse Events Action Path Out 0..1 boolean
Treated Adverse Events Action Path Out 0..1 boolean
Library Content
CQL Content
library AdverseEvents version '0.1'

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1' called FHIRHelpers
include OHSUHTNCommon version '0.1' called Common

codesystem "AdverseEventOutcomeCodeSystem": 'http://terminology.hl7.org/CodeSystem/adverse-event-outcome'
code "ongoing": 'ongoing' from "AdverseEventOutcomeCodeSystem" display 'Ongoing'
code "resolved": 'resolved' from "AdverseEventOutcomeCodeSystem" display 'Resolved'

context Patient

define function "AE Event Display"(codes List<FHIR.Coding>):
  First(codes C where C.code != 'coach-adverse-event').display

define function "AE Suggestion String"(aes List<FHIR.AdverseEvent>):
  aes AE return '{"id": "' + AE.id + '", "type": "adverse-event", "label": "' + "AE Event Display"(AE.event.coding) + '"}'

define function "Contact Suggestion String"(aes List<FHIR.AdverseEvent>):
  aes AE return "AE Event Display"(AE.event.coding)

define "Untreated Recommendation":
  'Report Side Effect'

define "Untreated Rationale Combined Data":
  "Untreated Rationale" + '|' + "Untreated Suggestions" + '|' + "Selection Behavior" + '|' + "Links"

define "Untreated Rationale":
  '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.'

define "Untreated Suggestions":
  '[{ "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team if you are currently experiencing a side effect" , "url":"/contact?token=untreated-adverse-event"}] },' +
  Combine("AE Suggestion String"("Untreated Adverse Events"), ',') +
  ']'

define "Untreated Indicator Status":
  'critical'

define "Treated Indicator Status":
  'warning'

define "Selection Behavior":
  'at-most-one'

define "Links":
  ''

define "Treated Recommendation":
  'See care team and discuss treatment if event recurs'

define "Treated Rationale Combined Data":
  "Treated Rationale" + '|' + "Treated Suggestions" + '|' + "Selection Behavior" + '|' + "Links"

define "Treated Rationale":
  'A side effect associated with blood pressure management has been detected and addressed: <strong>' + Combine("Contact Suggestion String"("Treated Adverse Events"), ', ') + '</strong>. 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.'

define "Treated Suggestions":
  '[]'

// Only get the adverse events coded from the application
define "Adverse Events":
  [AdverseEvent] AE where AE.event.coding.code contains 'coach-adverse-event'

define "Treated Adverse Events":
  "Adverse Events" AE where AE.outcome ~ "resolved"

define "Untreated Adverse Events":
  "Adverse Events" AE where AE.outcome ~ "ongoing"

define "Untreated Adverse Events Action Path":
  exists "Untreated Adverse Events"

define "Treated Adverse Events Action Path":
  exists "Treated Adverse Events"
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates