Skip to content

Commit

Permalink
Merge pull request #114 from cqframework/rec-backport
Browse files Browse the repository at this point in the history
Rec Backport with new terminology
  • Loading branch information
brynrhodes authored May 21, 2020
2 parents 80754cd + 0c06d83 commit a339f4d
Show file tree
Hide file tree
Showing 231 changed files with 789,921 additions and 210,906 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
/resources/ig-new.xml
/org.hl7.fhir.publisher.jar
template
input-cache
input-cache/*
!/input-cache/txcache
input/ig-expansion-parameters.json
input/ig-new.json
input/ig-new.xml
Expand Down
2 changes: 1 addition & 1 deletion _genonce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else
echo "Offline"
txoption="-tx n/a"
fi

txoption="-tx n/a"
echo "$txoption"

publisher=$input_cache_path/$publisher_jar
Expand Down
12 changes: 7 additions & 5 deletions _refresh.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@ECHO OFF
SET tooling_jar=tooling-1.1.0-SNAPSHOT-jar-with-dependencies.jar
SET input_cache_path=%~dp0input-cache
SET resources_path=%~dp0/input/resources
SET ig_resource_path=%~dp0/input/opioid-cds.xml

ECHO Checking internet connection...
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
Expand All @@ -10,18 +12,18 @@ GOTO igpublish

:isonline
ECHO We're online, setting publish to the Connectathon sandbox FHIR server
SET fsoption=-fs http://cqm-sandbox.alphora.com/cqf-ruler-r4/fhir/
SET fsoption=

:igpublish

SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

IF EXIST "%input_cache_path%\%tooling_jar%" (
ECHO running: JAVA -jar "%input_cache_path%\%tooling_jar%" -RefreshIG -ip=%~dp0 -iv=fhir4 -t -d -p -v %fsoption%
JAVA -jar "%input_cache_path%\%tooling_jar%" -RefreshIG -ip=%~dp0 -iv=fhir4 -t -d -p -v %fsoption%
ECHO running: JAVA -jar "%input_cache_path%\%tooling_jar%" -RefreshIG -ip=%~dp0 -rp="%resources_path%" -igrp="%ig_resource_path%" -iv=fhir3 -t -d -p %fsoption%
JAVA -jar "%input_cache_path%\%tooling_jar%" -RefreshIG -ip=%~dp0 -rp="%resources_path%" -igrp="%ig_resource_path%" -iv=fhir3 -t -d -p %fsoption%
) ELSE If exist "..\%tooling_jar%" (
ECHO running: JAVA -jar "..\%tooling_jar%" -RefreshIG -ip=%~dp0 -iv=fhir4 -t -d -p -v %fsoption%
JAVA -jar "..\%tooling_jar%" -RefreshIG -ip=%~dp0 -iv=fhir4 -t -d -p -v %fsoption%
ECHO running: JAVA -jar "..\%tooling_jar%" -RefreshIG -ip=%~dp0 -rp="%resources_path%" -igrp="%ig_resource_path%" -iv=fhir3 -t -d -p %fsoption%
JAVA -jar "..\%tooling_jar%" -RefreshIG -ip=%~dp0 -rp="%resources_path%" -igrp="%ig_resource_path%" -iv=fhir3 -t -d -p %fsoption%
) ELSE (
ECHO IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
)
Expand Down
11 changes: 7 additions & 4 deletions _refresh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
#DO NOT EDIT WITH WINDOWS
tooling_jar=tooling-1.1.0-SNAPSHOT-jar-with-dependencies.jar
input_cache_path=./input-cache
resources_path=$PWD/input/resources
ig_resource_path=./input/opioid-cds.xml

set -e
echo Checking internet connection...
wget -q --spider tx.fhir.org

if [ $? -eq 0 ]; then
echo "Online"
fsoption="-fs http://cqm-sandbox.alphora.com/cqf-ruler-r4/fhir/"
fsoption=""
#"-fs http://cds-sandbox.alphora.com/cqf-ruler-dstu3/fhir/"
else
echo "Offline"
fsoption=""
Expand All @@ -18,13 +22,12 @@ echo "$fsoption"

tooling=$input_cache_path/$tooling_jar
if test -f "$tooling"; then
JAVA -jar $tooling -RefreshIG -ip="$PWD" -iv=fhir4 -t -d -p -v $fsoption

JAVA -jar $tooling -RefreshIG -ip="$PWD" -igrp="$ig_resource_path" -rp="$resources_path" -iv=fhir3 -t -d -p $fsoption
else
tooling=../$tooling_jar
echo $tooling
if test -f "$tooling"; then
JAVA -jar $tooling -RefreshIG -ip=C%~dp0 -iv=fhir4 -t -d -p -v $fsoption
JAVA -jar $tooling -RefreshIG -ip="$PWD" -igrp="$ig_resource_path" -rp="$resources_path" -iv=fhir3 -t -d -p $fsoption
else
echo IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
fi
Expand Down
3 changes: 0 additions & 3 deletions _runant.bat

This file was deleted.

34 changes: 34 additions & 0 deletions bundlegen/_bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
#DO NOT EDIT WITH WINDOWS
tooling_jar=tooling-1.1.0-SNAPSHOT-jar-with-dependencies.jar
input_cache_path=./input-cache
bundlegen_path=$PWD/bundlegen


set -e
echo Checking internet connection...
wget -q --spider tx.fhir.org

if [ $? -eq 0 ]; then
echo "Online"
fsoption=""
#"-fs http://cqm-sandbox.alphora.com/cqf-ruler-r4/fhir/"
else
echo "Offline"
fsoption=""
fi

echo "$fsoption"

tooling=$input_cache_path/$tooling_jar
if test -f "$tooling"; then
JAVA -jar $tooling -BundleResources -ptd=$bundlegen_path op=$bundlegen_path -v=stu3 -e=json
else
tooling=../$tooling_jar
echo $tooling
if test -f "$tooling"; then
JAVA -jar $tooling -BundleResources -ptd=$bundlegen_path op=$bundlegen_path -v=stu3 -e=json
else
echo IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
fi
fi
34,753 changes: 34,753 additions & 0 deletions bundles/OpioidCDSREC04/OpioidCDSREC04-bundle.json

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions bundles/OpioidCDSREC04/OpioidCDSREC04-files/OpioidCDSREC04.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
library OpioidCDSREC04 version '1.2.0'

using FHIR version '3.0.0'

include FHIRHelpers version '3.0.0' called FHIRHelpers
include OpioidCDSCommon version '1.2.0' called Common
include OpioidCDSRoutines version '1.2.0' called Routines

/*
**
** Recommendation #4
** Prescribe immediate-release opioids instead of extended-release/long-acting (ER/LA) opioids
**
** When
** Provider is prescribing an extended release opioid with ambulatory misuse potential in the outpatient setting
** Prescription is for treating chronic pain.
** Opioid review is useful for this patient:
** Patient is 18 or over
** Patient does not have findings indicating limited life expectancy
** Patient does not have orders for therapies indicating end of life care
** Patient is not undergoing active cancer treatment:
** Patient has had at least 2 encounters within the past year with any diagnosis of cancer
** Patient is opioid naive:
** No indication of opioid use in the past 90 days from a prescription, self report, or a dispensing event
** Then
** Recommend use of immediate release opioids:
** Will prescribe immediate release opioid analgesic with ambulatory misuse potential
** Benefits outweigh risks, snooze 3 months
** N/A - see comment, snooze 3 months
**
*/

// META: Plan Definition: http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/opioid-cds-04

parameter ContextPrescriptions List<MedicationRequest>

context Patient

define "Inclusion Period":
Interval[Today() - 91 days, Today() - 1 days]

define "Encounter Period":
Interval[Today() - 12 months - 1 days, Today() - 1 days]

define "Chronic Pain Extended Release Opioid Analgesic with Ambulatory Misuse Potential Prescriptions":
( Common."Is Opioid Analgesic with Ambulatory Misuse Potential?"( ContextPrescriptions ) ) AmbulatoryOpioidPrescription
where Routines."Is Chronic Pain Prescription?"( AmbulatoryOpioidPrescription )
and AmbulatoryOpioidPrescription.medication in Common."Extended release opioid analgesics with ambulatory misuse potential"

define "Patient Is Being Prescribed Extended Release Opioid Analgesic with Ambulatory Misuse Potential":
exists( "Chronic Pain Extended Release Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" )

define "Is Recommendation Applicable?":
"Inclusion Criteria"
and not "Exclusion Criteria"

define "Inclusion Criteria":
"Patient Is Being Prescribed Extended Release Opioid Analgesic with Ambulatory Misuse Potential"
and Routines."Is Opioid Review Useful?"
and Routines."Is Opioid Naive?"

define "Exclusion Criteria":
false

define "Get Indicator":
if "Is Recommendation Applicable?"
then 'warning'
else null

define "Get Summary":
if "Is Recommendation Applicable?"
then 'Recommend use of immediate-release opioids instead of extended release/long acting opioids when starting patient on opioids.'
else null

define "Get Detail":
if "Is Recommendation Applicable?"
then 'The following medication requests(s) release rates should be re-evaluated: ' + Combine( flatten( Common.GetMedicationNames( "Chronic Pain Extended Release Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" ) ), ', ' )
else null

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"resourceType": "PlanDefinition",
"id": "opioidcds-04",
"url": "http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/opioidcds-04",
"version": "1.1.1",
"version": "1.2.0",
"name": "PlanDefinition_Recommendation_4",
"title": "PlanDefinition - CDC Opioid Prescribing Guideline Recommendation #4",
"type": {
Expand Down Expand Up @@ -90,7 +90,7 @@
"copyright": "© CDC 2016+.",
"library": [
{
"reference": "Library/opioidcds-recommendation-04"
"reference": "Library/library-OpioidCDSREC04"
}
],
"action": [
Expand Down Expand Up @@ -138,7 +138,7 @@
"triggerDefinition": [
{
"type": "named-event",
"eventName": "medication-prescribe"
"eventName": "order-select"
}
],
"condition": [
Expand Down Expand Up @@ -178,4 +178,4 @@
]
}
]
}
}
Loading

0 comments on commit a339f4d

Please sign in to comment.