Library Name |
Name |
SupplementalDataElements |
SDE Sex |
|
define "SDE Sex":
case
when Patient.gender = 'male' then "M"
when Patient.gender = 'female' then "F"
else null
end
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
SDE Sex |
|
define "SDE Sex":
SDE."SDE Sex"
|
Library Name |
Name |
TJCOverall |
Non Elective Inpatient Encounter With Age |
|
define "Non Elective Inpatient Encounter With Age":
["Encounter": "Nonelective Inpatient Encounter"] NonElectiveEncounter
where AgeInYearsAt(date from start of NonElectiveEncounter.period ) >= 18
and NonElectiveEncounter.period ends during day of "Measurement Period"
|
Library Name |
Name |
TJCOverall |
Ischemic Stroke Encounter |
|
define "Ischemic Stroke Encounter":
"Non Elective Inpatient Encounter With Age" NonElectiveEncounterWithAge
where NonElectiveEncounterWithAge.principalDiagnosis().code in "Ischemic Stroke"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Antithrombotic Therapy |
|
define "Encounter With Antithrombotic Therapy":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with ["MedicationAdministration": medication in "Antithrombotic Therapy for Ischemic Stroke"] Antithrombotic
such that Antithrombotic.status in { 'in-progress', 'completed' }
and Antithrombotic.effective.toInterval ( ) starts during day of ( start of IschemicStrokeEncounter.hospitalizationWithObservation ( ) ).CalendarDayOfOrDayAfter ( )
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Numerator |
|
define "Numerator":
"Encounter With Antithrombotic Therapy"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Initial Population |
|
define "Initial Population":
TJC."Ischemic Stroke Encounter"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Denominator |
|
define "Denominator":
"Initial Population"
|
Library Name |
Name |
SupplementalDataElements |
SDE Payer |
|
define "SDE Payer":
[Coverage: type in "Payer Type"] Payer
return {
code: Payer.type,
period: Payer.period
}
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
SDE Payer |
|
define "SDE Payer":
SDE."SDE Payer"
|
Library Name |
Name |
SupplementalDataElements |
SDE Ethnicity |
|
define "SDE Ethnicity":
Patient.ethnicity E
return Tuple {
codes: { E.ombCategory } union E.detailed,
display: E.text
}
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
SDE Ethnicity |
|
define "SDE Ethnicity":
SDE."SDE Ethnicity"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter Less Than Two Days |
|
define "Encounter Less Than Two Days":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
where IschemicStrokeEncounter.hospitalizationWithObservation ( ).lengthInDays ( ) < 2
|
Library Name |
Name |
TJCOverall |
Intervention Comfort Measures |
|
define "Intervention Comfort Measures":
( ["ServiceRequest": code in "Comfort Measures"] SR
where SR.status in { 'active', 'completed', 'on-hold' }
and SR.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
and SR.doNotPerform is not true
)
union ( ["Procedure": "Comfort Measures"] InterventionPerformed
where InterventionPerformed.status in { 'completed', 'in-progress' }
)
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Comfort Measures During Day Of Or Day After Arrival |
|
define "Encounter With Comfort Measures During Day Of Or Day After Arrival":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with TJC."Intervention Comfort Measures" ComfortMeasure
such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during day of ( start of IschemicStrokeEncounter.hospitalizationWithObservation ( ) ).CalendarDayOfOrDayAfter ( )
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Thrombolytic Therapy Medication Or Procedures |
|
define "Thrombolytic Therapy Medication Or Procedures":
( ["MedicationAdministration": medication in "Thrombolytic tPA Therapy"] ThrombolyticMedication
where ThrombolyticMedication.status in { 'in-progress', 'completed' }
return {
id: ThrombolyticMedication.id,
effective: ThrombolyticMedication.effective
}
)
union ( ["Procedure": "Intravenous or Intraarterial Thrombolytic tPA Therapy"] ThrombolyticProcedure
where ThrombolyticProcedure.status = 'completed'
return {
id: ThrombolyticProcedure.id,
effective: ThrombolyticProcedure.performed
}
)
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Thrombolytic Therapy Medication Or Procedures |
|
define "Encounter With Thrombolytic Therapy Medication Or Procedures":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with "Thrombolytic Therapy Medication Or Procedures" ThrombolyticTherapy
such that ThrombolyticTherapy.effective.toInterval ( ) starts during Interval[start of IschemicStrokeEncounter.hospitalizationWithObservation ( ) - 24 hours, end of IschemicStrokeEncounter.hospitalizationWithObservation ( ) )
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Thrombolytic Therapy Prior To Arrival |
|
define "Encounter With Thrombolytic Therapy Prior To Arrival":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
where exists ( ( IschemicStrokeEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis
where ( EncounterDiagnosis.code in "Intravenous or Intraarterial Thrombolytic tPA Therapy Prior to Arrival" )
)
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Thrombolytic Therapy Documented As Already Given |
|
define "Encounter With Thrombolytic Therapy Documented As Already Given":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with [Condition: "Intravenous or Intraarterial Thrombolytic tPA Therapy Prior to Arrival"] PriorTPA
such that PriorTPA.recordedDate during CQMCommon."HospitalizationWithObservation" ( IschemicStrokeEncounter )
and PriorTPA.isActive ( )
and PriorTPA.verificationStatus is not null
and PriorTPA.verificationStatus ~ QICoreCommon."confirmed"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Thrombolytic Therapy Given Prior To Arrival Or During Hospitalization |
|
define "Encounter With Thrombolytic Therapy Given Prior To Arrival Or During Hospitalization":
"Encounter With Thrombolytic Therapy Medication Or Procedures"
union "Encounter With Thrombolytic Therapy Prior To Arrival"
union "Encounter With Thrombolytic Therapy Documented As Already Given"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Denominator Exclusions |
|
define "Denominator Exclusions":
"Encounter Less Than Two Days"
union "Encounter With Comfort Measures During Day Of Or Day After Arrival"
union "Encounter With Thrombolytic Therapy Given Prior To Arrival Or During Hospitalization"
|
Library Name |
Name |
SupplementalDataElements |
SDE Race |
|
define "SDE Race":
Patient.race R
return Tuple {
codes: R.ombCategory union R.detailed,
display: R.text
}
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
SDE Race |
|
define "SDE Race":
SDE."SDE Race"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Reason For Not Ordering Antithrombotic |
|
define "Reason For Not Ordering Antithrombotic":
["MedicationNotRequested": medication in "Antithrombotic Therapy for Ischemic Stroke"] NoAntithromboticOrder
where NoAntithromboticOrder.status = 'completed'
and NoAntithromboticOrder.intent = 'order'
and ( NoAntithromboticOrder.reasonCode in "Medical Reason for Not Providing Treatment"
or NoAntithromboticOrder.reasonCode in "Patient Refusal"
)
return {
id: NoAntithromboticOrder.id,
authoredOn: NoAntithromboticOrder.authoredOn
}
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Reason For Not Administering Antithrombotic |
|
define "Reason For Not Administering Antithrombotic":
["MedicationAdministrationNotDone": medication in "Antithrombotic Therapy for Ischemic Stroke"] MedicationAdm
where ( MedicationAdm.statusReason in "Medical Reason for Not Providing Treatment"
or MedicationAdm.statusReason in "Patient Refusal"
)
return {
id: MedicationAdm.id,
authoredOn: MedicationAdm.recorded
}
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Documented Reason For No Antithrombotic Ordered Or Administered |
|
define "Documented Reason For No Antithrombotic Ordered Or Administered":
"Reason For Not Ordering Antithrombotic"
union "Reason For Not Administering Antithrombotic"
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Documented Reason For No Antithrombotic Ordered Or Administered Day Of Or Day After Hospital Arrival |
|
define "Encounter With Documented Reason For No Antithrombotic Ordered Or Administered Day Of Or Day After Hospital Arrival":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with "Documented Reason For No Antithrombotic Ordered Or Administered" NoAntithrombotic
such that NoAntithrombotic.authoredOn during day of ( start of IschemicStrokeEncounter.hospitalizationWithObservation ( ) ).CalendarDayOfOrDayAfter ( )
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With Pharmacological Contraindications For Antithrombotic Therapy Given Day Of Or Day After Hospital Arrival |
|
define "Encounter With Pharmacological Contraindications For Antithrombotic Therapy Given Day Of Or Day After Hospital Arrival":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with ["MedicationAdministration": medication in "Pharmacological Contraindications For Antithrombotic Therapy"] PharmacologicalContraindications
such that PharmacologicalContraindications.status in { 'in-progress', 'completed' }
and PharmacologicalContraindications.effective.toInterval ( ) starts during day of ( start of IschemicStrokeEncounter.hospitalizationWithObservation ( ) ).CalendarDayOfOrDayAfter ( )
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Encounter With An INR Greater Than 3.5 |
|
define "Encounter With An INR Greater Than 3.5":
TJC."Ischemic Stroke Encounter" IschemicStrokeEncounter
with ["Observation": "INR"] INR
such that INR.value as Quantity > 3.5
and INR.status in { 'final', 'amended', 'corrected' }
and INR.issued during day of ( start of IschemicStrokeEncounter.hospitalizationWithObservation ( ) ).CalendarDayOfOrDayAfter ( )
|
Library Name |
Name |
CMS72FHIRSTKAntithromboticDay2 |
Denominator Exceptions |
|
define "Denominator Exceptions":
"Encounter With Documented Reason For No Antithrombotic Ordered Or Administered Day Of Or Day After Hospital Arrival"
union "Encounter With Pharmacological Contraindications For Antithrombotic Therapy Given Day Of Or Day After Hospital Arrival"
union "Encounter With An INR Greater Than 3.5"
|
Library Name |
Name |
CQMCommon |
principalDiagnosis |
|
/*
@description: Returns the condition that is specified as the principal diagnosis for the encounter
*/
define fluent function principalDiagnosis(Encounter Encounter ):
singleton from ((Encounter.diagnosis D where D.rank = 1 and D.use ~ "Billing") PD
return singleton from ([Condition] C where C.id = PD.condition.reference.getId())
)
|
Library Name |
Name |
QICoreCommon |
getId |
|
/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
Last(Split(uri, '/'))
|
Library Name |
Name |
TJCOverall |
CalendarDayOfOrDayAfter |
|
define fluent function CalendarDayOfOrDayAfter(StartValue DateTime):
Interval [date from (StartValue), date from (StartValue) + 1 day]
|
Library Name |
Name |
CQMCommon |
hospitalizationWithObservation |
|
/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
*/
define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
TheEncounter Visit
let ObsVisit: Last([Encounter: "Observation Services"] LastObs
where LastObs.status = 'finished'
and LastObs.period ends 1 hour or less on or before start of Visit.period
sort by end of period
),
VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
where LastED.status = 'finished'
and LastED.period ends 1 hour or less on or before VisitStart
sort by end of period
)
return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]
|
Library Name |
Name |
FHIRHelpers |
ToString |
|
define function ToString(value uri): value.value
|
Library Name |
Name |
FHIRHelpers |
ToCode |
|
/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
if coding is null then
null
else
System.Code {
code: coding.code.value,
system: coding.system.value,
version: coding.version.value,
display: coding.display.value
}
|
Library Name |
Name |
CQMCommon |
lengthInDays |
|
/*
@description: Calculates the difference in calendar days between the start and end of the given interval.
*/
define fluent function lengthInDays(Value Interval<DateTime> ):
difference in days between start of Value and end of Value
|
Library Name |
Name |
CQMCommon |
encounterDiagnosis |
|
/*
@description: Returns the Condition resources referenced by the diagnosis element of the Encounter
*/
define fluent function encounterDiagnosis(Encounter Encounter ):
Encounter.diagnosis D
return singleton from ([Condition] C where C.id = D.condition.reference.getId())
|
Library Name |
Name |
CQMCommon |
HospitalizationWithObservation |
|
/*
@description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
@deprecated: This function is deprecated. Use the fluent function `hospitalizationWithObservation()` instead.
*/
define function "HospitalizationWithObservation"(TheEncounter Encounter ):
TheEncounter Visit
let ObsVisit: Last([Encounter: "Observation Services"] LastObs
where LastObs.status = 'finished'
and LastObs.period ends 1 hour or less on or before start of Visit.period
sort by end of period
),
VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
where LastED.status = 'finished'
and LastED.period ends 1 hour or less on or before VisitStart
sort by end of period
)
return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]
|
Library Name |
Name |
QICoreCommon |
isActive |
|
/* Candidates for FHIRCommon */
/*
@description: Returns true if the given condition has a clinical status of active, recurrence, or relapse
*/
define fluent function isActive(condition Condition):
condition.clinicalStatus ~ "active"
or condition.clinicalStatus ~ "recurrence"
or condition.clinicalStatus ~ "relapse"
|
Library Name |
Name |
FHIRHelpers |
ToConcept |
|
/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
if concept is null then
null
else
System.Concept {
codes: concept.coding C return ToCode(C),
display: concept.text.value
}
|