Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Qualifying Colonoscopy Procedure Performed |
|
define "Qualifying Colonoscopy Procedure Performed":
["Procedure": "Colonoscopy"] ColonoscopyPerformed
where ColonoscopyPerformed.status in { 'completed', 'in-progress' }
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Colorectal Screenings |
|
define "Colorectal Screenings":
[Observation: "Colorectal Screening"] ColorectalScreening
where ColorectalScreening.status in { 'final', 'amended', 'corrected' }
and ColorectalScreening.value is not null
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Qualifying Colorectal Screenings |
|
define "Qualifying Colorectal Screenings":
"Colorectal Screenings" CScreening
where CScreening.effective.toInterval ( ) during day of "Measurement Period"
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Qualifying Colorectal Screening with Positive Result |
|
define "Qualifying Colorectal Screening with Positive Result":
"Qualifying Colorectal Screenings" ColorectalScreening
where ColorectalScreening.value in { 'Positive', 'positive' }
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Index Colorectal Screening |
|
define "Index Colorectal Screening":
First("Qualifying Colorectal Screening with Positive Result" QCS
sort by issued
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Follow-up Diagnostic Evaluations Within 180 Days of the Index Colorectal Screening |
|
define "Has Follow-up Diagnostic Evaluations Within 180 Days of the Index Colorectal Screening":
exists ( "Qualifying Colonoscopy Procedure Performed" ColonoscopyProcedure
where ColonoscopyProcedure.performed starts 180 days or less on or after "Index Colorectal Screening".issued
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Numerator |
|
define "Numerator":
"Has Follow-up Diagnostic Evaluations Within 180 Days of the Index Colorectal Screening"
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Initial Population |
|
define "Initial Population":
/***
Patients aged between 45 and 75 years with at least 1 qualifying stool-based screening with positive result during the measurement period.
***/
AgeInYearsAt(date from start of "Measurement Period") in Interval[45, 75]
and exists ( "Qualifying Colorectal Screening with Positive Result" )
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Denominator |
|
define "Denominator":
"Initial Population"
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Inpatient Encounter |
|
define "Inpatient Encounter":
["Encounter": "Initial Hospital Inpatient Visit"] Hospitalencounter
where Hospitalencounter.status = 'finished'
and Hospitalencounter.period during "Measurement Period"
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Index Colorectal Screening Done During Hospitalization |
|
define "Index Colorectal Screening Done During Hospitalization":
"Inpatient Encounter" HospitalEncounter
with "Index Colorectal Screening" ICS
such that ICS.effective.toInterval ( ) starts during HospitalEncounter.period
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Index Colorectal Screening Done During Hospitalization |
|
define "Has Index Colorectal Screening Done During Hospitalization":
exists ( "Index Colorectal Screening Done During Hospitalization" )
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Positive Colorectal Screening Within 365 Days Prior |
|
define "Has Positive Colorectal Screening Within 365 Days Prior":
exists ( "Colorectal Screenings" PrevCS
where PrevCS.value in { 'Positive', 'positive' }
and PrevCS.effective.toInterval ( ) starts 365 days or less on or before "Index Colorectal Screening".issued
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Colorectal Cancer Prior to Index Colorectal Screening |
|
define "Has Colorectal Cancer Prior to Index Colorectal Screening":
exists ( [Condition: "Malignant Neoplasm of Colon"] ColorectalCancerCondition
where ( ColorectalCancerCondition.clinicalStatus ~ "active"
or ColorectalCancerCondition.clinicalStatus ~ "recurrence"
or ColorectalCancerCondition.clinicalStatus ~ "relapse"
)
and ColorectalCancerCondition.verificationStatus ~ "confirmed"
and ColorectalCancerCondition.recordedDate before "Index Colorectal Screening".issued
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Total Colectomy Procedure Performed Prior to Index Colorectal Screening |
|
define "Has Total Colectomy Procedure Performed Prior to Index Colorectal Screening":
exists ( [Procedure: "Total Colectomy"] TotalColectomyProcedure
where TotalColectomyProcedure.status = 'completed'
and TotalColectomyProcedure.performed ends on or before "Index Colorectal Screening".issued
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Hospice Care |
|
define "Has Hospice Care":
exists ( ["Encounter": "Inpatient Stay"] HospiceEncounter
where HospiceEncounter.status = 'finished'
and HospiceEncounter.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
and ( HospiceEncounter.period ends 1 year or less on or before "Index Colorectal Screening".issued
or HospiceEncounter.period starts 180 days or less on or after "Index Colorectal Screening".issued
)
)
or exists ( [ServiceRequest: "Hospice Care"] HospiceServiceOrder
where HospiceServiceOrder.intent = 'order'
and ( HospiceServiceOrder.authoredOn 1 year or less on or before "Index Colorectal Screening".issued
or HospiceServiceOrder.authoredOn 180 days or less on or after "Index Colorectal Screening".issued
)
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Palliative Care |
|
define "Has Palliative Care":
exists ( ["Procedure": "Palliative Care"] PalliativeCareProcedure
where PalliativeCareProcedure.status = 'completed'
and PalliativeCareProcedure.performed ends 1 year or less on or before "Index Colorectal Screening".issued
or PalliativeCareProcedure.performed starts 180 days or less on or after "Index Colorectal Screening".issued
)
or exists ( [ServiceRequest: "Palliative Care"] PalliativeCareOrder
where PalliativeCareOrder.intent = 'order'
and ( PalliativeCareOrder.authoredOn 1 year or less on or before "Index Colorectal Screening".issued
or PalliativeCareOrder.authoredOn 180 days or less on or after "Index Colorectal Screening".issued
)
)
or exists ( ["Encounter": "Palliative Care Encounter"] PalliativeCareEncounter
where PalliativeCareEncounter.status = 'finished'
and ( PalliativeCareEncounter.period ends 1 year or less on or before "Index Colorectal Screening".issued
or PalliativeCareEncounter.period starts 180 days or less on or after "Index Colorectal Screening".issued
)
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Denominator Exclusions |
|
define "Denominator Exclusions":
"Has Index Colorectal Screening Done During Hospitalization"
or "Has Positive Colorectal Screening Within 365 Days Prior"
or "Has Colorectal Cancer Prior to Index Colorectal Screening"
or "Has Total Colectomy Procedure Performed Prior to Index Colorectal Screening"
or "Has Hospice Care"
or "Has Palliative Care"
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Has Colonoscopy Procedure Performed Within 3 Years Prior to the Index Colorectal Screening |
|
define "Has Colonoscopy Procedure Performed Within 3 Years Prior to the Index Colorectal Screening":
exists ( "Qualifying Colonoscopy Procedure Performed" ColonoscopyProcedure
where ColonoscopyProcedure.performed starts 3 years or less on or before "Index Colorectal Screening".issued
)
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Patient Deceased Within 180 Days of the Index Colorectal Screening |
|
define "Patient Deceased Within 180 Days of the Index Colorectal Screening":
Patient.deceased.toInterval ( ) starts 180 days or less on or after "Index Colorectal Screening".issued
|
Library Name |
Name |
RateOfTimelyFollowUpForColorectalCancerDetection |
Denominator Exceptions |
|
define "Denominator Exceptions":
"Has Colonoscopy Procedure Performed Within 3 Years Prior to the Index Colorectal Screening"
or "Patient Deceased Within 180 Days of the Index Colorectal Screening"
|
Library Name |
Name |
QICoreCommon |
toInterval |
|
/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in QICore, allowing this function to be used across any resource.
The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.
If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
If the input is a DateTime Interval, the result is the input.
If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
*/
define fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>, Timing>):
case
when choice is DateTime then
Interval[choice as DateTime, choice as DateTime]
when choice is Interval<DateTime> then
choice as Interval<DateTime>
when choice is Quantity then
Interval[Patient.birthDate + (choice as Quantity),
Patient.birthDate + (choice as Quantity) + 1 year)
when choice is Interval<Quantity> then
Interval[Patient.birthDate + (choice.low as Quantity),
Patient.birthDate + (choice.high as Quantity) + 1 year)
when choice is Timing then
Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval<DateTime>
else
null as Interval<DateTime>
end
|