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 is not an authorized publication; it is the continuous build for version 0.1.0). 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 2023-05-11 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

Id: Monitoring
Url: http://fhir.org/guides/ohsuhypertensionig/Library/Monitoring
Version: 0.1.0
Name: Monitoring
Title: Monitoring Logic
Status: draft
Date: 2023-05-11 22:13:39+0000
Publisher: Oregon Health and Science University
Description:

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

Jurisdiction: 840
Copyright:

Published by OHSU under an Apache 2.0 License

Related Artifacts:
TypeResource
depends-onhttp://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
depends-onhttp://fhir.org/guides/ohsuhypertensionig/Library/FHIRHelpers|4.0.1
depends-onhttp://fhir.org/guides/ohsuhypertensionig/Library/OHSUHTNCommon|0.1
depends-onhttp://terminology.hl7.org/CodeSystem/condition-ver-status
depends-onhttp://terminology.hl7.org/CodeSystem/condition-category
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.104.12.1016
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1032.10
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.590
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.378
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1104.2
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.1045
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.2012
Parameters:
NameTypeMinMaxIn/Out
PatientPatient01out
Infostring01out
Warningstring01out
Criticalstring01out
ErrorsResource01out
Patient Namestring01out
Meets Inclusion Criteriaboolean01out
Meets Exclusion Criteriaboolean01out
In Populationboolean01out
Recommendationstring01out
Rationalestring01out
Suggestionsstring01out
Selection Behaviorstring01out
Linksstring01out
Rationale Combined Datastring01out
Indicator Statusstring01out
Exclusion Reasonstring01out
No Entry into Populationboolean01out
No Entry Titlestring01out
No Entry Descriptionstring01out
Test Count All BPinteger01out
Test Most Recent BPResource01out
Test Get All BP Observation ResourcesResource0*out
Test Get Has BP Setboolean01out
Test Get Most Recent BP SetResource0*out
Test All BP Last 2 YearsResource0*out
Test Get Average All BP Last 2 YearsResource01out
Test Get Average Most Recent BP SetResource01out
Test Get BP GoalResource01out
TEST Condition Prevalence PeriodPeriod0*out
TEST Condition Is Valid Prevalence Periodboolean0*out
TEST Condition Indicating Preexisting HypertensionCondition0*out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient ;;
Condition http://hl7.org/fhir/StructureDefinition/Condition ;;

code filter:
path: category

system: http://terminology.hl7.org/CodeSystem/condition-category

code: problem-list-item

display: Problem List Item

Condition http://hl7.org/fhir/StructureDefinition/Condition ;;

code filter:
path: category

system: http://terminology.hl7.org/CodeSystem/condition-category

code: encounter-diagnosis

display: Encounter Diagnosis

Observation http://hl7.org/fhir/StructureDefinition/Observation ;
Goal http://hl7.org/fhir/StructureDefinition/Goal ;;;;;
Content: text/cql
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"

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

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

define "Recommendation":
  if not "In Population" 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 BP Set" then 'Consider obtaining additional blood pressure measurements.'
  // 14.b
  else if Common."Above Goal Average Most Recent" then 'Blood pressure goal not reached. Discuss treatment options.'
  else 'Patient at goal'

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

define "Rationale":
  if not "In Population" 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 BP Set" then '{{#patient}}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 more than 4 in-office measurements, 6 home measurements, or 24 hours of ambulatory monitoring.{{/patient}}{{#careTeam}}Patient does not have enough blood pressures to make a strong determination of control or diagnosis. We consider a full set to be more than 4 in-office measurements, 6 home measurements, or 24 hours of ambulatory monitoring.{{/careTeam}}'
  else if Common."Above Goal Average Most Recent" then '{{#patient}}You are not currently at your blood pressure goal; one or more options presented here can provide more specific guidance about ways to lower your blood pressure. However, you can always ask questions of your care team if you need guidance or want to share your progress so far.{{/patient}}{{#careTeam}}BP not at goal. Consider initiating antihypertensive drug therapy with a single antihypertensive drug with dosage titration and sequential addition of other agents to achieve the target BP.{{/careTeam}}'
  else 'No Further Action Required'

define "Indicator Status":
  if not "In Population" then "Info"
  else if not Common."Patient has a BP Goal" then "Info"
  else if not Common."Has BP Set" then "Info"
  else if Common."Above Goal Average Most Recent" then "Warning"
  else "Info"

define "Suggestions":
  if not "In Population" 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 BP Set" 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 if Common."Above Goal Average Most Recent" then '[ { "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about options to control your high blood pressure", "url":"/contact?token=recommend-pharma-and-nonpharma"}] } ]'
  else ''

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

define "Links":
  if not "In Population" 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 BP Set" 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 if Common."Above Goal Average Most Recent" then '[{"label":"NIH: Controlling blood pressure", "url":"https://www.nhlbi.nih.gov/files/docs/public/heart/hbp_low.pdf"}]'
  else '[]'

define "Exclusion Reason":
  if "Meets Exclusion Criteria" then
    (
      'Patient was excluded from monitoring of hypertension due to '
      + (
          if Common."Patient Under Age 18" then 'being under the age of 18.'
          else if Common."Patient Over Age 80" then 'being over the age of 80.'
          else if exists Common."Condition Indicating End Stage Renal Disease" then 'having end stage renal disease.'
          else if exists Common."Condition Indicating Pregnancy" then 'being pregnant.'
          else if Common."HTN Crisis" then 'a recent high blood pressure warning.'
          else ''
        )
    )
  else ''

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

define "No Entry Title":
  'Patient did not have a preexisting hypertensive condition.'

define "No Entry Description":
  'No Further Action Required.'

/* 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"
Content: application/elm+xml
Encoded data (107868 characters)
Content: application/elm+json
Encoded data (186980 characters)