Skip to content

Commit

Permalink
Merge pull request #192 from OHSUCMP/issue-191
Browse files Browse the repository at this point in the history
#191: Handle Low BP recommendation.
  • Loading branch information
aeyates authored Oct 24, 2023
2 parents 3a2836b + 9d26aae commit 70154ae
Show file tree
Hide file tree
Showing 39 changed files with 4,657 additions and 28 deletions.
27 changes: 19 additions & 8 deletions input/cql/HypertensiveEmergency.cql
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ context Patient
define function "BP Within 14 Days"(O Tuple { id String, effective DateTime, systolic Decimal, diastolic Decimal, readingType String }):
O.effective + 14 days >= Today()

// Two Low BPs are handled through an adverse event creation
define "In Population":
Common."HTN Crisis"
Common."HTN Crisis" and not "Two Low BPs"

define "BP Observation Count":
Count(Common."All BP Observations" O)
Expand All @@ -21,20 +22,22 @@ define "Next Most Recent BP Reading":
else null

define "Two High BPs":
"In Population" and "BP Within 14 Days"(Common."Most Recent BP Reading") and
Common."HTN High Crisis" and "BP Within 14 Days"(Common."Most Recent BP Reading") and
"BP Within 14 Days"("Next Most Recent BP Reading") and Common."HTN Crisis BP"("Next Most Recent BP Reading")

define "Two Low BPs":
Common."HTN Low Crisis" and Common."HTN Low Crisis BP"("Next Most Recent BP Reading")

define "Recommendation":
if "Two High BPs" then 'Blank.Summary'
else if "In Population" then 'Blank.Summary'
else null
'Blank.Summary'

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

define "Rationale":
if "Two High BPs" then 'Your last two BP readings >=180 mmHg systolic and/or >=120 mmHg diastolic) are very high. <strong>If you <a href="/symptoms-911">do not feel well</a>, call 911; otherwise, it is strongly recommended that you now contact your clinic.</strong>'
else if "In Population" then 'Remain calm and check your BP again following these <a href="/vitals#instructions">instructions</a> in 5 to 30 minutes. Read more about managing very high blood pressure in the link below.'
else if Common."HTN High Crisis" then 'Remain calm and check your BP again following these <a href="/vitals#instructions">instructions</a> in 5 to 30 minutes. Read more about managing very high blood pressure in the link below.'
else if Common."HTN Low Crisis" then 'Remain calm and check your BP again following these <a href="/vitals#instructions">instructions</a> in 5 to 30 minutes. Read more about symptoms from low blood pressure in the link below.'
else null

define "Indicator Status":
Expand All @@ -44,14 +47,16 @@ define "Indicator Status":

define "Suggestions":
if "Two High BPs" then '[{"id": "display-clinic-contact", "label": "", "type": "clinic-contact"}]'
else if "In Population" then '[ { "id": "enter-bp-suggestion", "label": "Enter Blood Pressure", "type": "suggestion-link", "actions": [{"label":"Check your BP again (strongly recommended)", "url":"/vitals"}] } ]'
else if Common."HTN Crisis" then '[ { "id": "enter-bp-suggestion", "label": "Enter Blood Pressure", "type": "suggestion-link", "actions": [{"label":"Check your BP again (strongly recommended)", "url":"/vitals"}] } ]'
else null

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

define "Links":
'[{"label":"American Heart Association: When to call 911 for high blood pressure", "url":"https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings/hypertensive-crisis-when-you-should-call-911-for-high-blood-pressure"}]'
if "Two High BPs" or Common."HTN High Crisis" then '[{"label":"American Heart Association: When to call 911 for high blood pressure", "url":"https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings/hypertensive-crisis-when-you-should-call-911-for-high-blood-pressure"}]'
else if Common."HTN Low Crisis" then '[{"label":"American Heart Association: When Blood Pressure is too Low", "url":"https://www.heart.org/en/health-topics/high-blood-pressure/the-facts-about-high-blood-pressure/low-blood-pressure-when-blood-pressure-is-too-low"}]'
else null

define "TEST Most Recent BP Reading":
Common."Most Recent BP Reading"
Expand All @@ -62,3 +67,9 @@ define "TEST Next Most Recent BP Reading":
define "TEST Two High BPs":
"Two High BPs"

define "TEST Two Low BPs":
"Two Low BPs"

define "TEST One Low BP":
Common."HTN Low Crisis"

11 changes: 10 additions & 1 deletion input/cql/OHSUHTNCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ define function "HTN Stage 2 BP Systolic Second Test"(list List<Tuple { id Strin
define function "HTN Crisis BP"(O Tuple { id String, effective DateTime, systolic Decimal, diastolic Decimal, readingType String }):
O.systolic >= 180 or O.diastolic >= 120

define function "HTN Low Crisis BP"(O Tuple { id String, effective DateTime, systolic Decimal, diastolic Decimal, readingType String }):
O.systolic < 90 or O.diastolic < 60

/* Helpers */
define function WithUnit(list List<Observation>, Unit String):
list Observations
Expand Down Expand Up @@ -450,9 +453,15 @@ define "All BP Observations":
define "Most Recent BP Reading":
Last("All BP Observations" O sort by effective)

define "HTN Crisis":
define "HTN High Crisis":
"HTN Crisis BP"("Most Recent BP Reading")

define "HTN Low Crisis":
"HTN Low Crisis BP"("Most Recent BP Reading")

define "HTN Crisis":
"HTN High Crisis" or "HTN Low Crisis"

define "Blood Pressure Observations for Last 2 Years":
"All BP Observations" BP where BP.effective + 24 months >= Today()
sort by effective
Expand Down
36 changes: 27 additions & 9 deletions input/resources/library/HypertensiveEmergency.json

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions input/resources/library/OHSUHTNCommon.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions input/resources/library/Pharma.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"version": "0.1",
"name": "HypertensiveEmergency",
"title": "High Blood Pressure Warning",
"title": "Blood Pressure Warning",
"type": {
"coding": [
{
Expand All @@ -23,8 +23,8 @@
"status": "draft",
"date": "2020-02-04T00:00:00-08:00",
"publisher": "Oregon Health and Science University (OHSU)",
"description": "This PlanDefinition detects a recent high blood pressure reading.",
"purpose": "The purpose is to identify very high blood pressure and recommend the patient seek treatment.",
"description": "This PlanDefinition detects a recent high or low blood pressure reading.",
"purpose": "The purpose is to identify very high or low blood pressure and recommend the patient seek treatment.",
"usage": "This is to be used in conjunction with a patient-facing FHIR application.",
"jurisdiction": [
{
Expand All @@ -49,7 +49,7 @@
"action": [
{
"title": "Recommendation",
"description": "Recommendation for patient with a recent very high blood pressure",
"description": "Recommendation for patient with a recent high or low blood pressure",
"trigger": [{
"type": "named-event",
"name":"patient-view"
Expand All @@ -58,7 +58,7 @@
{
"kind": "applicability",
"expression": {
"description": "Determine if patient had a recent very high blood pressure",
"description": "Determine if patient had a recent high or low blood pressure",
"language": "text/cql.identifier",
"expression": "In Population"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"resourceType": "Condition",
"id": "condition-HE-SingleLowBP-1",
"note": [
{
"text": "Indicates Preexisting Diagnosis of Hypertension"
}
],
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-category",
"code": "problem-list-item",
"display": "Problem List Item"
}
],
"text": "Problem List Item"
}
],
"clinicalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active"
}
]
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
"code": "confirmed"
}
]
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "59621000",
"display": "Hypertension"
}
],
"text": "Hypertension"
},
"subject": {
"reference": "Patient/HE-SingleLowBP"
},
"onsetDateTime": "2017-01-23T15:16:21-05:00",
"recordedDate": "2017-01-23T15:16:21-05:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Encounter",
"id": "encounter-HE-SingleLowBP-1",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
},
"type": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "162673000",
"display": "General examination of patient (procedure)"
}
],
"text": "General examination of patient (procedure)"
}
],
"subject": {
"reference": "Patient/HE-SingleLowBP"
},
"period": {
"start": "2023-01-22T00:00:00-04:00",
"end": "2023-01-22T23:59:59-04:00"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Encounter",
"id": "encounter-HE-SingleLowBP-2",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
},
"type": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "162673000",
"display": "General examination of patient (procedure)"
}
],
"text": "General examination of patient (procedure)"
}
],
"subject": {
"reference": "Patient/HE-SingleLowBP"
},
"period": {
"start": "2023-02-22T00:00:00-04:00",
"end": "2023-02-22T23:59:59-04:00"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Encounter",
"id": "encounter-HE-SingleLowBP-3",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
},
"type": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "162673000",
"display": "General examination of patient (procedure)"
}
],
"text": "General examination of patient (procedure)"
}
],
"subject": {
"reference": "Patient/HE-SingleLowBP"
},
"period": {
"start": "2023-03-22T00:00:00-04:00",
"end": "2023-03-22T23:59:59-04:00"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Encounter",
"id": "encounter-HE-SingleLowBP-4",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
},
"type": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "162673000",
"display": "General examination of patient (procedure)"
}
],
"text": "General examination of patient (procedure)"
}
],
"subject": {
"reference": "Patient/HE-SingleLowBP"
},
"period": {
"start": "2023-04-22T00:00:00-04:00",
"end": "2023-04-22T23:59:59-04:00"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"resourceType": "Goal",
"id": "goal-HE-SingleLowBP-1",
"lifecycleStatus": "active",
"achievementStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/goal-achievement",
"version": "4.0.1",
"code": "in-progress",
"display": "In Progress"
}
]
},
"statusDate": "2023-07-08",
"startDate": "2023-07-08",
"description": {
"text": "Goal of 135/85"
},
"subject": {
"reference": "Patient/HE-SingleLowBP"
},
"target": [
{
"measure": {
"coding": [
{
"system": "http://loinc.org",
"version": "2.68",
"code": "8480-6",
"display": "Systolic blood pressure"
}
]
},
"detailQuantity": {
"value": 135,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
},
{
"measure": {
"coding": [
{
"system": "http://loinc.org",
"version": "2.68",
"code": "8462-4",
"display": "Diastolic blood pressure"
}
]
},
"detailQuantity": {
"value": 85,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
}
]
}
Loading

0 comments on commit 70154ae

Please sign in to comment.