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: Monitoring Logic

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

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

Decision logic for monitoring progress in a patient previously diagnosed with hypertension

Metadata
Title Monitoring 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 monitoring progress in a patient previously diagnosed with hypertension

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 ConditionVerificationStatusCodes
Resource: ConditionVerificationStatus
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-ver-status
Dependency Description: Code system ConditionCategorySystem
Resource: Condition Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-category
Dependency Description: Value set Hypertension
Resource: Hypertension
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.104.12.1016
Dependency Description: Value set Non essential Hypertension SNOMEDCT
Resource: Non essential Hypertension SNOMEDCT
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1032.10
Dependency Description: Value set Systolic Blood Pressure
Resource: Systolic blood pressure
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1104.2
Dependency Description: Value set Diastolic Blood Pressure
Resource: Diastolic Blood Pressure
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.1045
Dependency Description: Value set Blood Pressure Measured
Resource: Blood Pressure Measured
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.2012
Dependency Description: Value set End Stage Renal Disease
Resource: End Stage Renal Disease
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.590
Dependency Description: Value set Pregnancy
Resource: Pregnancy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.378
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: given, family
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: code
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code
Data Requirement Type: Goal
Profile(s): Goal
Must Support Elements: target, systolic, systolic.value, diastolic, diastolic.value
Parameters
Name Use Card. Type Documentation
Patient Out 0..1 Patient
Info Out 0..1 string
Warning Out 0..1 string
Critical Out 0..1 string
Errors Out 0..1 Resource
Patient Name Out 0..1 string
Meets Inclusion Criteria Out 0..1 boolean
Meets Exclusion Criteria Out 0..1 boolean
In Population Out 0..1 boolean
Provide Recommendation Out 0..1 boolean
Recommendation Out 0..1 string
Rationale Out 0..1 string
Suggestions Out 0..1 string
Selection Behavior Out 0..1 string
Links Out 0..1 string
Rationale Combined Data Out 0..1 string
Indicator Status Out 0..1 string
No Entry into Population Out 0..1 boolean
Test Count All BP Out 0..1 integer
Test Most Recent BP Out 0..1 Resource
Test Get All BP Observation Resources Out 0..* Resource
Test Get Has BP Set Out 0..1 boolean
Test Get Most Recent BP Set Out 0..* Resource
Test All BP Last 2 Years Out 0..* Resource
Test Get Average All BP Last 2 Years Out 0..1 Resource
Test Get Average Most Recent BP Set Out 0..1 Resource
Test Get BP Goal Out 0..1 Resource
TEST Condition Prevalence Period Out 0..* Period
TEST Condition Is Valid Prevalence Period Out 0..* boolean
TEST Condition Indicating Preexisting Hypertension Out 0..* Condition
TEST Problem Conditions Out 0..* Condition
TEST Encounter Conditions Out 0..* Condition
Test Home BPs Out 0..1 integer
Library Content
CQL Content
library Monitoring version '0.1'

using FHIR version '4.0.1'

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

context Patient

define "Info":
  'info'

define "Warning":
  'warning'

define "Critical":
  'critical'

define "Errors":
  null

define "Patient Name":
  First(Patient.name.given)
   + ' ' +
  First(Patient.name.family)

/* Recommendation Criteria - Monitoring Hypertension  */
define "Meets Inclusion Criteria":
 exists Common."Condition Indicating Preexisting Hypertension" and not Common."HTN Crisis"

define "Meets Exclusion Criteria":
  Common."Patient Under Age 18"
    or Common."Patient Over Age 100"
    or exists Common."Condition Indicating End Stage Renal Disease"
    or exists Common."Condition Indicating Pregnancy"

define "In Population":
  // Preserve this ordering so excluded patients fail fast
  not "Meets Exclusion Criteria" and "Meets Inclusion Criteria"

define "Provide Recommendation":
  "In Population" and (not Common."Patient has a BP Goal" or not Common."Has 12 Home BPs" or not Common."Above Goal Average Most Recent")

define "Recommendation":
  if not "Provide Recommendation" then ''
  // 12
  else if not Common."Patient has a BP Goal" then 'Discuss target blood pressure and set a blood pressure goal'
  // 13
  else if not Common."Has 12 Home BPs" then 'Consider obtaining additional blood pressure measurements.'
  // Patient at Goal
  else 'Monitoring.Success.Summary' // COACH must look for this hack to display the green checkmark

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

define "Rationale":
  if not "Provide Recommendation" then ''
  else if not Common."Patient has a BP Goal" then '{{#patient}}You recently received a hypertension (high blood pressure) diagnosis.  Setting goals for lowering your blood pressure has been proven to help overall health and reduce your chance of stroke or other conditions.{{/patient}}{{#careTeam}}No BP Goal set: Setting a blood pressure goal can help engage patients and improve outcomes. For most patients, choosing a target between <120-140/80-90 is recommended; lower targets may be for ASCVD, ASCVD risk >10%, multimorbidity (CKD and diabetes), or preference; higher targets may be for age, adverse events, or frailty.{{/careTeam}}'
  else if not Common."Has 12 Home BPs" then 'Since we do not have enough blood pressure measurements to obtain a full picture of your health, we recommend you take a full set of measurements. We consider a full set to be at least 12 home measurements.'
  // Patient at Goal
  else 'At or below your goal BP: Keep up the good work! Click the link for what to do next.'

define "Indicator Status":
  "Info"

define "Suggestions":
  if not "Provide Recommendation" then ''
  else if not Common."Patient has a BP Goal" then '[ { "id": "bp-radio-goal", "label": "BP Goal", "type": "bp-goal", "references":{"system":"https://coach.ohsu.edu", "code":"blood-pressure"}, "actions": [{"label":"140/90"}, {"label":"130/80"}, {"label":"120/80"}]}]'
  else if not Common."Has 12 Home BPs" then '[ { "id": "enter-bp-suggestion", "label": "Enter Blood Pressure", "type": "suggestion-link", "actions": [{"label":"Click here to go to the Home Blood Pressure entry page.", "url":"/vitals"}] } ]'
  else '[ { "id": "link-suggestion", "label": "", "type": "suggestion-link", "actions": [{"label":"My blood pressure is controlled: What to do next?", "url":"/infographic-controlled-bp.pdf"}] } ]'

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

define "Links":
  if not "Provide Recommendation" then ''
  else if not Common."Patient has a BP Goal" then '[{"label": "AHA: Understanding High Blood Pressure Readings", "url": "https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings"}]'
  else if not Common."Has 12 Home BPs" then '[{"label":"Bell 2021: The potential for overdiagnosis and underdiagnosis because of blood pressure variability: a comparison of the 2017 ACC/AHA, 2018 ESC/ESH and 2019 NICE hypertension guidelines", "url":"https://pubmed.ncbi.nlm.nih.gov/32773652/"}]'
  else '[]'

define "No Entry into Population":
  not "Meets Inclusion Criteria"
    and not "Meets Exclusion Criteria"

/* TESTS */
define "Test Count All BP":
  Count(Common."Blood Pressure Observations for Last 2 Years")

define "Test Most Recent BP":
  Common."Most Recent BP Reading" BP

define "Test Get All BP Observation Resources":
  Common."All BP Observations" BP

define "Test Get Has BP Set":
  Common."Has BP Set"

define "Test Get Most Recent BP Set":
  Common."Most Recent BP Set" BPSet

define "Test All BP Last 2 Years":
  Common."Blood Pressure Observations for Last 2 Years"

define "Test Get Average All BP Last 2 Years":
  Common."Avg BP"(Common."Blood Pressure Observations for Last 2 Years")

define "Test Get Average Most Recent BP Set":
  Common."Avg BP"(Common."Most Recent BP Set")

define "Test Get BP Goal":
  Common."BP from Most Recent Goal" BPGoal
    return Tuple { systolic: BPGoal.systolic.value,  diastolic: BPGoal.diastolic.value }

define "TEST Condition Prevalence Period":
  Common."Conditions" Problem
    return Common."Prevalence Period"(Problem)

define "TEST Condition Is Valid Prevalence Period":
  Common."Conditions" Problem
    return Common."Is Valid Prevalence Period"(Problem)

define "TEST Condition Indicating Preexisting Hypertension":
  Common."Condition Indicating Preexisting Hypertension"

define "TEST Problem Conditions":
  Common."Problem Conditions"

define "TEST Encounter Conditions":
  Common."Encounter Conditions"

define "Test Home BPs":
  Count(Common."Home Blood Pressure Observations")
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates