Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Questionnaire",
"id": "HomeBloodGlucoseMonitorLab",
"id": "HomeBloodGlucoseMonitor",
"name": "HomeBloodGlucoseMonitorLab",
"title": "Blood Glucose Laboratory Test Results",
"status": "draft",
Expand Down
66 changes: 66 additions & 0 deletions CRD-DTR/RemsDrugs/R4/files/RemsDrugsPrepopulation-0.1.0.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
library RemsDrugsPrepopulation version '0.1.0'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0' called FHIRHelpers
include CDS_Connect_Commons_for_FHIRv400 version '1.0.2' called CDS
include DTRHelpers version '0.1.0' called DTR

codesystem "ICD-10-CM": 'http://hl7.org/fhir/sid/icd-10-cm'
codesystem "LOINC": 'http://loinc.org'
codesystem "SNOMED-CT": 'http://snomed.info/sct'

valueset "OrganTransplantHistoryValueSet": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.81'
valueset "OrganTransplantProcedureValueSet": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.90'
valueset "ImmunosuppressiveMedicationValueSet": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.192'
valueset "ImmunosuppressiveSupportiveMedicationValueSet": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.193'


parameter medication_request MedicationRequest
parameter medication_dispense MedicationDispense

context Patient

define "QualifyingTransplant": [Condition: "OrganTransplantHistoryValueSet"]

define "QualifyingTransplantProcedures": [Procedure: "OrganTransplantProcedureValueSet"]

define "QualifyingTransplantCodings": DTR.CodesFromConditions("QualifyingTransplant") union DTR.CodesFromProcedures("QualifyingTransplantProcedures")

// get the first transplant date
define "TransplantDate":
if exists("QualifyingTransplant") then First("QualifyingTransplant").recordedDate.value
else First("QualifyingTransplantProcedures").performed.value union First("QualifyingTransplantProcedures").performed.start.value

// Get all medication related information
define "MedicationCodingFromParameter": Coalesce(medication_request.medication.coding, medication_dispense.medication.coding)

define MedicationCoding: singleton from (
"MedicationCodingFromParameter" CODING
where CODING in "ImmunosuppressiveMedicationValueSet"
or CODING in "ImmunosuppressiveSupportiveMedicationValueSet")

define "MedicationName": MedicationCoding.display.value

define "MedicationCode" : MedicationCoding.code.value

define "MedicationDosage": Coalesce(medication_request.dosageInstruction[0], medication_dispense.dosageInstruction[0])

define "MedicationDoseAndRate": MedicationDosage.doseAndRate[0]

define "MedicationDoseWithUnit": ToString(MedicationDoseAndRate.dose.value.value) + ' ' + MedicationDoseAndRate.dose.unit.value

define "MedicationRoute": MedicationDosage.route.coding[0].display.value

define "MedicationFrequency" : ToString(MedicationDosage.timing.repeat.frequency.value) + ' per ' + ToString(MedicationDosage.timing.repeat.period.value) + '' + MedicationDosage.timing.repeat.periodUnit.value

define CurrentDiagnoses:
DTR.CodesFromConditions(CDS.Confirmed(CDS.ActiveOrRecurring([Condition]))) except QualifyingTransplant

define "MedicationQuantity": Coalesce(medication_dispense.quantity.value, medication_request.dispenseRequest.quantity.value.value)

define "MedicationRefill":
if medication_request.dispenseRequest is not null
then medication_request.dispenseRequest.numberOfRepeatsAllowed.value
else
null

define "IsMedicationRequest": medication_request.id is not null
60 changes: 60 additions & 0 deletions CRD-DTR/RemsDrugs/R4/files/RemsDrugsRule-0.1.0.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
library RemsDrugsRule version '0.1.0'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0' called FHIRHelpers


parameter Patient Patient
parameter medication_request MedicationRequest
parameter medication_dispense MedicationDispense
parameter medication_statement MedicationStatement

define RULE_APPLIES:
true

define PRIORAUTH_REQUIRED:
false

define DOCUMENTATION_REQUIRED:
true

define RESULT_InfoLink:
'https://www.accessdata.fda.gov/drugsatfda_docs/rems/Turalio_2020_08_04_REMS_Full.pdf'

define RESULT_QuestionnaireOrderUri:
'Questionnaire/TuralioRemsPatientEnrollment'

define RESULT_QuestionnaireDispenseUri:
'Questionnaire/TuralioRemsPatientEnrollment'

define RESULT_QuestionnaireProgressNoteUri:
'Questionnaire/TuralioRemsPatientStatus'

define RESULT_requestId:
medication_request

define RESULT_dispense:
medication_dispense

define "MedicationCodingFromParameter": Coalesce(medication_request.medication.coding, medication_dispense.medication.coding)

define "MedicationStatementCodingFromParamter": medication_statement.medication.coding

define ALTERNATIVE_THERAPY:
if MedicationCodingFromParameter.code.value in { '105611', '239983' }
then Code { code: '197388', display: 'Azathioprine 50 MG Oral', system: 'http://www.nlm.nih.gov/research/umls/rxnorm' }
else null

define DRUG_INTERACTION:
if MedicationCodingFromParameter.code.value in { '105585' }
and MedicationStatementCodingFromParamter.code.value in { '105611', '197388', '239983' }
then true
else if MedicationCodingFromParameter.code.value in { '105611', '197388', '239983' }
and MedicationStatementCodingFromParamter.code.value in { '105585' }
then true
else false

define REQUESTED_DRUG_CODE:
MedicationCodingFromParameter

define STATEMENT_DRUG_CODE:
MedicationStatementCodingFromParamter
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"resourceType": "Library",
"id": "RemsDrugs-prepopulation",
"url": "http://hl7.org/fhir/us/davinci-dtr/Library/RemsDrugs-prepopulation",
"name": "RemsDrugs-prepopulation",
"version": "0.1.0",
"title": "RemsDrugs Prepopulation",
"status": "draft",
"type": {
"coding": [
{
"code": "logic-library"
}
]
},
"relatedArtifact": [
{
"type": "depends-on",
"resource": "Library/FHIRHelpers-4.0.0"
},
{
"type": "depends-on",
"resource": "Library/CDS_Connect_Commons_for_FHIRv400"
},
{
"type": "depends-on",
"resource": "Library/DTRHelpers"
}
],
"dataRequirement": [
{
"type": "Condition",
"codeFilter": [
{
"path": "code",
"valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.81"
}
]
},
{
"type": "Procedure",
"codeFilter": [
{
"path": "code",
"valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.90"
}
]
},
{
"type": "MedicationRequest",
"codeFilter": [
{
"path": "code",
"valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.192"
}
]
},
{
"type": "MedicationRequest",
"codeFilter": [
{
"path": "code",
"valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1219.193"
}
]
}
],
"content": [
{
"contentType": "application/elm+json",
"url": "files/RemsDrugs/r4/RemsDrugsPrepopulation-0.1.0.cql"
}
]
}
Loading