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: Adverse Event Logic

Official URL: http://fhir.org/guides/ohsuhypertensionig/Library/AdverseEvents Version: 0.1.0
Draft as of 2023-05-11 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

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

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

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/adverse-event-outcome
Parameters:
NameTypeMinMaxIn/Out
PatientPatient01out
Untreated Recommendationstring01out
Untreated Rationalestring01out
Adverse EventsAdverseEvent0*out
Untreated Adverse EventsAdverseEvent0*out
Untreated Suggestionsstring01out
Selection Behaviorstring01out
Linksstring01out
Untreated Rationale Combined Datastring01out
Untreated Indicator Statusstring01out
Treated Indicator Statusstring01out
Treated Recommendationstring01out
Treated Rationalestring01out
Treated Adverse EventsAdverseEvent0*out
Treated Suggestionsstring01out
Treated Rationale Combined Datastring01out
Untreated Adverse Events Action Pathboolean01out
Treated Adverse Events Action Pathboolean01out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
AdverseEvent http://hl7.org/fhir/StructureDefinition/AdverseEvent ;;;
Content: text/cql
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":
  'Consider adjusting treatment.'

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

define "Untreated Rationale":
  '{{#patient}}You recently had a condition recorded that <strong>may be an adverse event from high blood pressure treatment</strong>. Contacting your care team will help them resolve it.{{/patient}}{{#careTeam}}Patient recently experienced an adverse reaction to antihypertensive medication. Work with patient to resolve the event, utilizing team-based care and telehealth strategies as needed.{{/careTeam}}'

define "Untreated Suggestions":
  '[{ "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about your condition(s): ' + Combine("Contact Suggestion String"("Untreated Adverse Events"), ', ') + '" , "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 for hypertension if event recurs.'

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

define "Treated Rationale":
  '{{#patient}}You recently had a condition recorded that may be an adverse event from high blood pressure treatment; you noted to us that this was already treated, but <strong>if it recurs or doesn\'t get better, please contact your care team</strong>.{{/patient}}{{#careTeam}}Patient has experienced an adverse event, which has been treated. Consider changes to the patient\'s course of treatment if the patient requests modification to care or if the benefits of continues treatment do not outweigh the risks.{{/careTeam}}'

define "Treated Suggestions":
  '[ { "id": "contact-suggestion", "label": "Contact care team", "type": "suggestion-link", "actions": [{"label":"Contact your care team about your condition(s): ' + Combine("Contact Suggestion String"("Treated Adverse Events"), ', ') + '" , "url":"/contact?token=treated-adverse-event"}] } ]'

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