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: Initial Diagnosis Logic

Official URL: http://fhir.org/guides/ohsuhypertensionig/Library/Hypertension Version: 0.1.0
Active as of 2020-04-15 Computable Name: Hypertension

Copyright/Legal: © OHSU 2020+.

Decision logic for identifying hypertension in undiagnosed patients

The purpose of this is to act as a ‘hello world’ sort of simple logic for testing end-to-end processing of the system.

Id: Hypertension
Url: http://fhir.org/guides/ohsuhypertensionig/Library/Hypertension
Version: 0.1.0
Name: Hypertension
Title: Initial Diagnosis Logic
Status: active
Experimental: false
Type:

system: http://hl7.org/fhir/library-type

code: logic-library

display: Logic Library

Date: 2020-04-15 00:00:00-0800
Publisher: Oregon Health and Science University
Description:

Decision logic for identifying hypertension in undiagnosed patients

Use Context:
codevalue
focus
Jurisdiction: 840
Purpose:

The purpose of this is to act as a 'hello world' sort of simple logic for testing end-to-end processing of the system.

Usage: This is to be used in conjunction with a patient-facing FHIR application.
Copyright:

© OHSU 2020+.

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/v3-ActCode
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
Patient Has HTN Stage 2 BPboolean01out
HTN Stage 2boolean01out
Consider HTN Stage 2boolean01out
Consider HTN Stage 1boolean01out
Prescribe Monitoring to Confirm HTNboolean01out
No Further Actionboolean01out
Recommendation Neededboolean01out
Recommendationstring01out
Rationalestring01out
Suggestionsstring01out
Selection Behaviorstring01out
Linksstring01out
Rationale Combined Datastring01out
Indicator Statusstring01out
Exclusion Reasonstring01out
Test Most Recent BPResource01out
Test Get All BP Observation ResourcesResource0*out
Test Get Most Recent BP SetResource0*out
Test Average BP of SetResource01out
Test All BP Last 2 YearsResource0*out
Test Get Average All BP Last 2 YearsResource01out
Test Get Average Most Recent BP SetResource01out
Home Blood PressuresResource0*out
Test Patient Age on BP Readinginteger01out
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 ;
Content: text/cql
library Hypertension 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 "v3 Code System ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'

code "ambulatory": 'AMB' from "v3 Code System ActCode" display 'ambulatory'

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 - Hypertension  */
define "Meets Inclusion Criteria":
 not 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 "No Further Action":
  "In Population" and Common."Has BP Set" and not "HTN Stage 2" and not "Consider HTN Stage 2" and not "Consider HTN Stage 1" and not "Prescribe Monitoring to Confirm HTN"

define "Recommendation Needed":
  "In Population" and not "No Further Action"

define "Recommendation":
  if not "In Population" then 'None'
  else if not Common."Has BP Set" then 'Consider obtaining additional blood pressure measurements.'
  else if "HTN Stage 2" then 'Possible diagnosis of Stage 2 hypertension.'
  else if "Consider HTN Stage 2" then 'Possible diagnosis of Stage 2 hypertension.'
  else if "Consider HTN Stage 1" then 'Possible diagnosis of Stage 1 hypertension.'
  else if "Prescribe Monitoring to Confirm HTN" then 'Use home blood pressure monitoring to provide more information to your care team.'
  else 'No Further Action'

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

define "Rationale":
  if not "In Population" then 'None'
  else if not Common."Has BP Set" then '{{#patient}}You recently had a high blood pressure reading, but <strong>we do not have enough blood pressure measurements</strong> to obtain a full picture of your current health. We consider a full set of measurements 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 "HTN Stage 2" then '{{#patient}}You had multiple high blood pressure readings recently (>= 140 mmHg systolic and/or >= 90 mmHg diastolic). These readings <strong>suggest you have stage 2 hypertension</strong>, a treatable condition of high blood pressure. Please discuss next steps with your care team.{{/patient}}{{#careTeam}}Patient had multiple blood pressure readings of SBP >= 140 mm HG and/or DBP >= 90 mm Hg. This strongly suggests the patient has Stage 2 Hypertension but no diagnosis was found.{{/careTeam}}'
  else if "Consider HTN Stage 2" then '{{#patient}}You recently had high blood pressure readings (>= 140 mmHg systolic and/or >= 90 mmHg diastolic) which <strong>suggest you have hypertension</strong>, but there is no diagnosis in your chart. Please discuss next steps with your care team.{{/patient}}{{#careTeam}}Patient had multiple blood pressure readings of SBP > 140mm Hg and/or DBP > 90. This suggests the patient may have Stage 2 Hypertension, but no diagnosis was found.{{/careTeam}}'
  else if "Consider HTN Stage 1" then '{{#patient}}You recently had high blood pressure readings (>= 130 mmHg systolic and/or >= 80 mmHg diastolic) which <strong>suggest you have hypertension</strong>, but do not have a recorded diagnosis of hypertension. Please discuss next steps with your care team.{{/patient}}{{#careTeam}}Patient had multiple blood pressure readings of SBP > 130mm Hg and/or DBP > 80. This suggests the patient may have Stage 1 Hypertension, but no diagnosis was found.{{/careTeam}}'
  else if "Prescribe Monitoring to Confirm HTN" then '{{#patient}}You recently had a <strong>high blood pressure reading</strong>, but do not have a recorded diagnosis of hypertension. Discuss out of office blood pressure monitoring with your care team.{{/patient}}{{#careTeam}}In adults with suspected hypertension and without diagnostic uncertainty or BP variability, use Ambulatory Blood Pressure Monitoring or HBPM for diagnostic confirmation.{{/careTeam}}'
  else 'None'

define "Indicator Status":
  if not "In Population" then "Info"
  else if not Common."Has BP Set" then "Info"
  else if "HTN Stage 2" then "Warning"
  else if "Consider HTN Stage 2" then "Info"
  else if "Consider HTN Stage 1" then "Info"
  else if "Prescribe Monitoring to Confirm HTN" then "Info"
  else "Info"

define "Suggestions":
  if not "In Population" then 'None'
  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 "HTN Stage 2" then '[ { "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about a high blood pressure diagnosis", "url":"/contact?token=suspect-htn-stage2"}] } ]'
  else if "Consider HTN Stage 2" then '[ { "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about a high blood pressure diagnosis", "url":"/contact?token=possible-htn-stage2"}] } ]'
  else if "Consider HTN Stage 1" then '[ { "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about a high blood pressure diagnosis", "url":"/contact?token=possible-htn-stage1"}] } ]'
  else if "Prescribe Monitoring to Confirm HTN" then '[ { "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about out of office blood pressure measurements", "url":"/contact?token=office-bps"}] } ]'
  else 'None'

define "Selection Behavior":
  if not "In Population" then 'None'
  else if not Common."Has BP Set" then 'at-most-one'
  else if "HTN Stage 2" then 'at-most-one'
  else if "Consider HTN Stage 2" then 'at-most-one'
  else if "Consider HTN Stage 1" then 'at-most-one'
  else if "Prescribe Monitoring to Confirm HTN" then 'at-most-one'
  else 'at-most-one'

define "Links":
  if not "In Population" then ''
  else if not Common."Has BP Set" then '[{"label":"CDC: How to measure blood pressure", "url":"https://www.cdc.gov/bloodpressure/measure.htm"}]'
  else if "HTN Stage 2" 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 "Consider HTN Stage 2" 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 "Consider HTN Stage 1" 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 "Prescribe Monitoring to Confirm HTN" then '[{"label":"AHA: Monitoring your blood pressure at home", "url":"https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings/monitoring-your-blood-pressure-at-home"}]'
  else '[]'

define "Exclusion Reason":
  if "Meets Exclusion Criteria" then
    (
      'Patient was excluded from initial diagnosis 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 ''

// Is last BP set or all BPs average > 160 SBP?
define "Patient Has HTN Stage 2 BP":
  Common."Patient Has Potential HTN Stage 2 BP"
    and (
        Common."HTN Stage 2 BP Systolic Second Test"(Common."Most Recent BP Set") is not null
        or Common."HTN Stage 2 BP Systolic Second Test"(Common."Blood Pressure Observations for Last 2 Years") is not null
    )

define "HTN Stage 2":
  "In Population" and "Patient Has HTN Stage 2 BP"

define "Consider HTN Stage 2":
  "In Population" and Common."Patient Has Potential HTN Stage 2 BP"
      and not "Patient Has HTN Stage 2 BP"

// Is last BP set AND all BPs avg > 130/80?
define "Consider HTN Stage 1":
  "In Population" and (
    Common."HTN Stage 1 BP"(Common."Most Recent BP Set") is not null
    and Common."HTN Stage 1 BP"(Common."Blood Pressure Observations for Last 2 Years") is not null
  )

define "Prescribe Monitoring to Confirm HTN":
  "In Population" and Common."Patient Has Potential HTN Stage 1 BP" and not "Consider HTN Stage 1"

/* TESTS */
define "Test Most Recent BP":
  Common."Most Recent BP Reading"

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

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

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

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

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 "Home Blood Pressures":
  Common."Home Blood Pressure Observations"

define "Test Patient Age on BP Reading":
  AgeInYearsAt(Common."Most Recent BP Reading".effective)
Content: application/elm+xml
Encoded data (140460 characters)
Content: application/elm+json
Encoded data (244440 characters)