Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Qualifying Encounters |
|
define "Qualifying Encounters":
( ( [Encounter: "Office Visit"]
union [Encounter: "Telephone Visits"]
union [Encounter: "Virtual Encounter"]
).isEncounterPerformed ( ) ) ValidEncounter
where ValidEncounter.period.toInterval ( ) during day of "Measurement Period"
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date PROMIS10 Total Assessment Completed |
|
define "Date PROMIS10 Total Assessment Completed":
from
( ( [Observation: "PROMIS-10 Global Mental Health (GMH) score T-score"] ).isAssessmentPerformed ( ) ) PROMIS10MentalScore,
( ( [Observation: "PROMIS-10 Global Physical Health (GPH) score T-score"] ).isAssessmentPerformed ( ) ) PROMIS10PhysicalScore
let PROMIS10MentalScoreDate: date from start of PROMIS10MentalScore.effective.toInterval ( ),
PROMIS10PhysicalScoreDate: date from start of PROMIS10PhysicalScore.effective.toInterval ( )
where PROMIS10MentalScoreDate same day as PROMIS10PhysicalScoreDate
and PROMIS10MentalScore.value is not null
and PROMIS10PhysicalScore.value is not null
return PROMIS10MentalScoreDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up PROMIS10 Assessments |
|
define "Has Encounter with Initial and Follow Up PROMIS10 Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date PROMIS10 Total Assessment Completed" InitialPROMIS10Date,
"Date PROMIS10 Total Assessment Completed" FollowupPROMIS10Date
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialPROMIS10Date 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupPROMIS10Date during day of Interval[date from InitialPROMIS10Date + 30 days, date from InitialPROMIS10Date + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date PROMIS29 Total Assessment Completed |
|
define "Date PROMIS29 Total Assessment Completed":
from
( ( [Observation: "PROMIS-29 Sleep disturbance score T-score"] ).isAssessmentPerformed ( ) ) Promis29Sleep,
( ( [Observation: "PROMIS-29 Satisfaction with participation in social roles score T-score"] ).isAssessmentPerformed ( ) ) Promis29SocialRoles,
( ( [Observation: "PROMIS-29 Physical function score T-score"] ).isAssessmentPerformed ( ) ) Promis29Physical,
( ( [Observation: "PROMIS-29 Pain interference score T-score"] ).isAssessmentPerformed ( ) ) Promis29Pain,
( ( [Observation: "PROMIS-29 Fatigue score T-score"] ).isAssessmentPerformed ( ) ) Promis29Fatigue,
( ( [Observation: "PROMIS-29 Depression score T-score"] ).isAssessmentPerformed ( ) ) Promis29Depression,
( ( [Observation: "PROMIS-29 Anxiety score T-score"] ).isAssessmentPerformed ( ) ) Promis29Anxiety
let Promis29SleepDate: date from start of Promis29Sleep.effective.toInterval ( ),
Promis29SocialRolesDate: date from start of Promis29SocialRoles.effective.toInterval ( ),
Promis29PhysicalDate: date from start of Promis29Physical.effective.toInterval ( ),
Promis29PainDate: date from start of Promis29Pain.effective.toInterval ( ),
Promis29FatigueDate: date from start of Promis29Fatigue.effective.toInterval ( ),
Promis29DepressionDate: date from start of Promis29Depression.effective.toInterval ( ),
Promis29AnxietyDate: date from start of Promis29Anxiety.effective.toInterval ( )
where Promis29SleepDate same day as Promis29SocialRolesDate
and Promis29SocialRoles.value is not null
and Promis29SleepDate same day as Promis29PhysicalDate
and Promis29Physical.value is not null
and Promis29SleepDate same day as Promis29PainDate
and Promis29Pain.value is not null
and Promis29SleepDate same day as Promis29FatigueDate
and Promis29Fatigue.value is not null
and Promis29SleepDate same day as Promis29DepressionDate
and Promis29Depression.value is not null
and Promis29SleepDate same day as Promis29AnxietyDate
and Promis29Anxiety.value is not null
and Promis29Sleep.value is not null
return Promis29SleepDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up PROMIS29 Assessments |
|
define "Has Encounter with Initial and Follow Up PROMIS29 Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date PROMIS29 Total Assessment Completed" InitialPROMIS29Date,
"Date PROMIS29 Total Assessment Completed" FollowupPROMIS29Date
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialPROMIS29Date 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupPROMIS29Date during day of Interval[date from InitialPROMIS29Date + 30 days, date from InitialPROMIS29Date + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date VR12 Oblique Total Assessment Completed |
|
define "Date VR12 Oblique Total Assessment Completed":
from
( ( [Observation: "VR-12 Mental component summary (MCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR12MentalAssessment,
( ( [Observation: "VR-12 Physical component summary (PCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR12PhysicalAssessment
let VR12MentalAssessmentDate: date from start of VR12MentalAssessment.effective.toInterval ( ),
VR12PhysicalAssessmentDate: date from start of VR12PhysicalAssessment.effective.toInterval ( )
where VR12MentalAssessmentDate same day as VR12PhysicalAssessmentDate
and VR12MentalAssessment.value is not null
and VR12PhysicalAssessment.value is not null
return VR12MentalAssessmentDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up VR12 Oblique Assessments |
|
define "Has Encounter with Initial and Follow Up VR12 Oblique Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date VR12 Oblique Total Assessment Completed" InitialVR12ObliqueDate,
"Date VR12 Oblique Total Assessment Completed" FollowupVR12ObliqueDate
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialVR12ObliqueDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupVR12ObliqueDate during day of Interval[date from InitialVR12ObliqueDate + 30 days, date from InitialVR12ObliqueDate + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date VR12 Orthogonal Total Assessment Completed |
|
define "Date VR12 Orthogonal Total Assessment Completed":
from
( ( [Observation: "VR-12 Mental component summary (MCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR12MentalAssessment,
( ( [Observation: "VR-12 Physical component summary (PCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR12PhysicalAssessment
let VR12MentalAssessmentDate: date from start of VR12MentalAssessment.effective.toInterval ( ),
VR12PhysicalAssessmentDate: date from start of VR12PhysicalAssessment.effective.toInterval ( )
where VR12MentalAssessmentDate same day as VR12PhysicalAssessmentDate
and VR12MentalAssessment.value is not null
and VR12PhysicalAssessment.value is not null
return VR12MentalAssessmentDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments |
|
define "Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date VR12 Orthogonal Total Assessment Completed" InitialVR12OrthogonalDate,
"Date VR12 Orthogonal Total Assessment Completed" FollowupVR12OrthogonalDate
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialVR12OrthogonalDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupVR12OrthogonalDate during day of Interval[date from InitialVR12OrthogonalDate + 30 days, date from InitialVR12OrthogonalDate + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date VR36 Oblique Total Assessment Completed |
|
define "Date VR36 Oblique Total Assessment Completed":
from
( ( [Observation: "VR-36 Mental component summary (MCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR36MentalAssessment,
( ( [Observation: "VR-36 Physical component summary (PCS) score - oblique method T-score"] ).isAssessmentPerformed ( ) ) VR36PhysicalAssessment
let VR36MentalAssessmentDate: date from start of VR36MentalAssessment.effective.toInterval ( ),
VR36PhysicalAssessmentDate: date from start of VR36PhysicalAssessment.effective.toInterval ( )
where VR36MentalAssessmentDate same day as VR36PhysicalAssessmentDate
and VR36MentalAssessment.value is not null
and VR36PhysicalAssessment.value is not null
return VR36MentalAssessmentDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up VR36 Oblique Assessments |
|
define "Has Encounter with Initial and Follow Up VR36 Oblique Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date VR36 Oblique Total Assessment Completed" InitialVR36ObliqueDate,
"Date VR36 Oblique Total Assessment Completed" FollowupVR36ObliqueDate
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialVR36ObliqueDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupVR36ObliqueDate during day of Interval[date from InitialVR36ObliqueDate + 30 days, date from InitialVR36ObliqueDate + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date VR36 Orthogonal Total Assessment Completed |
|
define "Date VR36 Orthogonal Total Assessment Completed":
from
( ( [Observation: "VR-36 Mental component summary (MCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR36MentalAssessment,
( ( [Observation: "VR-36 Physical component summary (PCS) score - orthogonal method T-score"] ).isAssessmentPerformed ( ) ) VR36PhysicalAssessment
let VR36MentalAssessmentDate: date from start of VR36MentalAssessment.effective.toInterval ( ),
VR36PhysicalAssessmentDate: date from start of VR36PhysicalAssessment.effective.toInterval ( )
where VR36MentalAssessmentDate same day as VR36PhysicalAssessmentDate
and VR36MentalAssessment.value is not null
and VR36PhysicalAssessment.value is not null
return VR36MentalAssessmentDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments |
|
define "Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date VR36 Orthogonal Total Assessment Completed" InitialVR36OrthogonalDate,
"Date VR36 Orthogonal Total Assessment Completed" FollowupVR36OrthogonalDate
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialVR36OrthogonalDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupVR36OrthogonalDate during day of Interval[date from InitialVR36OrthogonalDate + 30 days, date from InitialVR36OrthogonalDate + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date MLHFQ Total Assessment Completed |
|
define "Date MLHFQ Total Assessment Completed":
from
( ( [Observation: "Physical score [MLHFQ]"] ).isAssessmentPerformed ( ) ) MLHFQPhysical,
( ( [Observation: "Emotional score [MLHFQ]"] ).isAssessmentPerformed ( ) ) MLHFQEmotional
let MLHFQPhysicalDate: date from start of MLHFQPhysical.effective.toInterval ( ),
MLHFQEmotionalDate: date from start of MLHFQEmotional.effective.toInterval ( )
where MLHFQPhysicalDate same day as MLHFQEmotionalDate
and MLHFQPhysical.value is not null
and MLHFQEmotional.value is not null
return MLHFQPhysicalDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up MLHFQ Assessments |
|
define "Has Encounter with Initial and Follow Up MLHFQ Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date MLHFQ Total Assessment Completed" InitialMLHFQDate,
"Date MLHFQ Total Assessment Completed" FollowupMLHFQDate
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialMLHFQDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupMLHFQDate during day of Interval[date from InitialMLHFQDate + 30 days, date from InitialMLHFQDate + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date KCCQ12 Total Assessment Completed |
|
define "Date KCCQ12 Total Assessment Completed":
from
( ( [Observation: "Kansas City Cardiomyopathy Questionnaire - 12 item [KCCQ-12]"] ).isAssessmentPerformed ( ) ) KCCQ12Item,
( ( [Observation: "Overall summary score [KCCQ-12]"] ).isAssessmentPerformed ( ) ) KCCQ12Summary
let KCCQ12ItemDate: date from start of KCCQ12Item.effective.toInterval ( ),
KCCQ12SummaryDate: date from start of KCCQ12Summary.effective.toInterval ( )
where KCCQ12ItemDate same day as KCCQ12SummaryDate
and KCCQ12Item.value is not null
and KCCQ12Summary.value is not null
return KCCQ12ItemDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up KCCQ12 Assessments |
|
define "Has Encounter with Initial and Follow Up KCCQ12 Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date KCCQ12 Total Assessment Completed" InitialKCCQ12Date,
"Date KCCQ12 Total Assessment Completed" FollowupKCCQ12Date
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialKCCQ12Date 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupKCCQ12Date during day of Interval[date from InitialKCCQ12Date + 30 days, date from InitialKCCQ12Date + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date KCCQ Domain Assessment Completed |
|
define "Date KCCQ Domain Assessment Completed":
from
( ( [Observation: "Quality of life score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQLifeQuality,
( ( [Observation: "Symptom stability score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSymptomStability,
( ( [Observation: "Self-efficacy score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSelfEfficacy,
( ( [Observation: "Total symptom score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSymptoms,
( ( [Observation: "Physical limitation score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQPhysicalLimits,
( ( [Observation: "Social limitation score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSocialLimits
let KCCQLifeQualityDate: date from start of KCCQLifeQuality.effective.toInterval ( ),
KCCQSymptomStabilityDate: date from start of KCCQSymptomStability.effective.toInterval ( ),
KCCQSelfEfficacyDate: date from start of KCCQSelfEfficacy.effective.toInterval ( ),
KCCQSymptomsDate: date from start of KCCQSymptoms.effective.toInterval ( ),
KCCQPhysicalLimitsDate: date from start of KCCQPhysicalLimits.effective.toInterval ( ),
KCCQSocialLimitsDate: date from start of KCCQSocialLimits.effective.toInterval ( )
where KCCQLifeQualityDate same day as KCCQSymptomStabilityDate
and KCCQSymptomStability.value is not null
and KCCQLifeQualityDate same day as KCCQSelfEfficacyDate
and KCCQSelfEfficacy.value is not null
and KCCQLifeQualityDate same day as KCCQSymptomsDate
and KCCQSymptoms.value is not null
and KCCQLifeQualityDate same day as KCCQPhysicalLimitsDate
and KCCQPhysicalLimits.value is not null
and KCCQLifeQualityDate same day as KCCQSocialLimitsDate
and KCCQSocialLimits.value is not null
and KCCQLifeQuality.value is not null
return KCCQLifeQualityDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments |
|
define "Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date KCCQ Domain Assessment Completed" InitialKCCQAssessmentDate,
"Date KCCQ Domain Assessment Completed" FollowupKCCQAssessmentDate
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialKCCQAssessmentDate 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupKCCQAssessmentDate during day of Interval[date from InitialKCCQAssessmentDate + 30 days, date from InitialKCCQAssessmentDate + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Date KCCQ Total Assessment Completed |
|
define "Date KCCQ Total Assessment Completed":
( ( [Observation: "Overall summary score [KCCQ]"] ).isAssessmentPerformed ( ) ) KCCQSummaryScore
let KCCQSummaryScoreDate: date from start of KCCQSummaryScore.effective.toInterval ( )
where KCCQSummaryScore.value is not null
return KCCQSummaryScoreDate
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Has Encounter with Initial and Follow Up KCCQ Total Score Assessments |
|
define "Has Encounter with Initial and Follow Up KCCQ Total Score Assessments":
exists ( from
"Qualifying Encounters" ValidEncounters,
"Date KCCQ Total Assessment Completed" InitialKCCQTotalScore,
"Date KCCQ Total Assessment Completed" FollowupKCCQTotalScore
where ValidEncounters.period.toInterval ( ) ends 180 days or more before day of end of "Measurement Period"
and InitialKCCQTotalScore 14 days or less on or before day of end of ValidEncounters.period.toInterval ( )
and date from FollowupKCCQTotalScore during day of Interval[date from InitialKCCQTotalScore + 30 days, date from InitialKCCQTotalScore + 180 days]
return ValidEncounters
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Numerator |
|
define "Numerator":
( "Has Encounter with Initial and Follow Up PROMIS10 Assessments" )
or ( "Has Encounter with Initial and Follow Up PROMIS29 Assessments" )
or ( "Has Encounter with Initial and Follow Up VR12 Oblique Assessments" )
or ( "Has Encounter with Initial and Follow Up VR12 Orthogonal Assessments" )
or ( "Has Encounter with Initial and Follow Up VR36 Oblique Assessments" )
or ( "Has Encounter with Initial and Follow Up VR36 Orthogonal Assessments" )
or ( "Has Encounter with Initial and Follow Up MLHFQ Assessments" )
or ( "Has Encounter with Initial and Follow Up KCCQ12 Assessments" )
or ( "Has Encounter with Initial and Follow Up KCCQ Domain Score Assessments" )
or ( "Has Encounter with Initial and Follow Up KCCQ Total Score Assessments" )
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Two Outpatient Encounters during Measurement Period |
|
define "Two Outpatient Encounters during Measurement Period":
from
"Qualifying Encounters" OfficeVisit1,
"Qualifying Encounters" OfficeVisit2
where OfficeVisit2.period.toInterval ( ) starts 1 day or more after day of end of OfficeVisit1.period.toInterval ( )
return OfficeVisit1
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Initial Population |
|
define "Initial Population":
AgeInYearsAt(date from start of "Measurement Period") >= 18
and exists ( ( [Condition: "Heart Failure"] ) HeartFailure
where HeartFailure.prevalenceInterval ( ) overlaps before "Measurement Period"
)
and exists ( "Two Outpatient Encounters during Measurement Period" )
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Denominator |
|
define "Denominator":
"Initial Population"
|
Library Name |
Name |
Hospice |
Has Hospice Services |
|
define "Has Hospice Services":
exists ((([Encounter: "Encounter Inpatient"]).isEncounterPerformed()) InpatientEncounter
where (InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
or InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)"
)
and InpatientEncounter.period.toInterval() ends during day of "Measurement Period"
)
or exists ((([Encounter: "Hospice Encounter"]).isEncounterPerformed()) HospiceEncounter
where HospiceEncounter.period.toInterval() overlaps day of "Measurement Period"
)
or exists ((([Observation: "Hospice care [Minimum Data Set]"]).isAssessmentPerformed()) HospiceAssessment
where HospiceAssessment.value ~ "Yes (qualifier value)"
and HospiceAssessment.effective.toInterval() overlaps day of "Measurement Period"
)
or exists ((([ServiceRequest: "Hospice Care Ambulatory"]).isInterventionOrder()) HospiceOrder
where HospiceOrder.authoredOn.toInterval() during day of "Measurement Period"
// and HospiceOrder.doNotPerform is not true
// https://oncprojectracking.healthit.gov/support/browse/CQLIT-447
)
or exists ((([Procedure: "Hospice Care Ambulatory"]).isInterventionPerformed()) HospicePerformed
where HospicePerformed.performed.toInterval() overlaps day of "Measurement Period"
)
or exists (([Condition: "Hospice Diagnosis"]) HospiceCareDiagnosis
where HospiceCareDiagnosis.prevalenceInterval() overlaps day of "Measurement Period"
)
|
Library Name |
Name |
FunctionalStatusAssessmentsforHeartFailureFHIR |
Denominator Exclusions |
|
define "Denominator Exclusions":
Hospice."Has Hospice Services"
or exists ( ( [Condition: "Severe cognitive impairment (finding)"] ) SevereCognitiveImpairment
where SevereCognitiveImpairment.prevalenceInterval ( ) overlaps "Measurement Period"
)
|
Library Name |
Name |
Status |
isEncounterPerformed |
|
//Encounter, Performed
//General usage unless required otherwise by measure intent (e.g., follow-up encounters)
define fluent function isEncounterPerformed(Enc List<Encounter>):
Enc E
where E.status in {'finished', 'arrived', 'triaged', 'in-progress', 'onleave'}
|
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
|
Library Name |
Name |
Status |
isAssessmentPerformed |
|
//This library contains functions that are based on QDM 5.6 to QICore 4.1.1 March 2023 (https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns---QICore-v4.1.1). The functions may appear similar to some QICoreCommon functions but different in that they have constraints that are relevant for measures authored by NCQA.
//Assessment, Performed
define fluent function isAssessmentPerformed(Obs List<Observation>):
Obs O
where O.status in { 'final', 'amended', 'corrected' }
and exists ( O.category ObservationCategory
where ( ObservationCategory ) ~ "survey"
)
|
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
}
|
Library Name |
Name |
QICoreCommon |
prevalenceInterval |
|
/*
@description: Returns an interval representing the normalized prevalence period of a given Condition.
@comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition. If the condition is active, or has an abatement date the resulting
interval will have a closed ending boundary. Otherwise, the resulting interval will have an open ending boundary.
*/
define fluent function prevalenceInterval(condition Condition):
if condition.clinicalStatus ~ "active"
or condition.clinicalStatus ~ "recurrence"
or condition.clinicalStatus ~ "relapse" then
Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
else
(end of condition.abatementInterval()) abatementDate
return if abatementDate is null then
Interval[start of condition.onset.toInterval(), abatementDate)
else
Interval[start of condition.onset.toInterval(), abatementDate]
|
Library Name |
Name |
Status |
isInterventionOrder |
|
//Intervention, Order: active and completed only
define fluent function isInterventionOrder(ServiceRequest List<ServiceRequest>):
ServiceRequest S
where S.status in { 'active', 'completed' }
and S.intent = 'order'
|
Library Name |
Name |
Status |
isInterventionPerformed |
|
//Intervention, Performed
define fluent function isInterventionPerformed(Proc List<Procedure>):
Proc P
where P.status ~ 'completed'
|