├── .gitignore ├── .travis.yml ├── FHIR Measure Test Cases TEMPLATE.xlsx ├── README.md ├── _runant.bat ├── build.xml ├── bundles └── release │ ├── fhir4 │ ├── EXM104_FHIR4-8.1.000 │ │ ├── EXM104_FHIR4-8.1.000-bundle.json │ │ └── EXM104_FHIR4-8.1.000-files │ │ │ ├── EXM104_FHIR4-8.1.000.cql │ │ │ ├── library-EXM104_FHIR4-8.1.000.json │ │ │ ├── library-deps-EXM104_FHIR4-8.1.000-bundle.json │ │ │ ├── measure-EXM104_FHIR4-8.1.000.json │ │ │ ├── measurereport-EXM104-FHIR4-8.1.000-denom.json │ │ │ ├── measurereport-EXM104_FHIR4-8.1.000-numer.json │ │ │ ├── tests-denom-EXM104_FHIR4-bundle.json │ │ │ ├── tests-numer-EXM104_FHIR4-bundle.json │ │ │ └── valuesets-EXM104_FHIR4-8.1.000-bundle.json │ ├── EXM105_FHIR4-8.1.000 │ │ ├── EXM105_FHIR4-8.1.000-bundle.json │ │ └── EXM105_FHIR4-8.1.000-files │ │ │ ├── EXM105_FHIR4-8.1.000.cql │ │ │ ├── library-EXM105_FHIR4-8.1.000.json │ │ │ ├── library-deps-EXM105_FHIR4-8.1.000-bundle.json │ │ │ ├── measure-EXM105_FHIR4-8.1.000.json │ │ │ ├── measurereport-EXM105-FHIR4-8.1.000-denom.json │ │ │ ├── measurereport-EXM105-FHIR4-8.1.000-numer.json │ │ │ ├── measurereport-denom-EXM105_FHIR4-8.1.000-expectedresults.json │ │ │ ├── measurereport-numer-EXM105_FHIR4-8.1.000-expectedresults.json │ │ │ ├── tests-denom-EXM105-FHIR4-bundle.json │ │ │ ├── tests-denom-EXM105_FHIR4-bundle.json │ │ │ ├── tests-numer-EXM105-FHIR4-bundle.json │ │ │ ├── tests-numer-EXM105_FHIR4-bundle.json │ │ │ └── valuesets-EXM105_FHIR4-8.1.000-bundle.json │ ├── EXM108_FHIR4-8.2.000 │ │ ├── EXM108_FHIR4-8.2.000-bundle.json │ │ └── EXM108_FHIR4-8.2.000-files │ │ │ ├── EXM108_FHIR4-8.2.000.cql │ │ │ ├── library-EXM108_FHIR4-8.2.000.json │ │ │ ├── library-deps-EXM108_FHIR4-8.2.000-bundle.json │ │ │ ├── measure-EXM108_FHIR4-8.2.000.json │ │ │ ├── measurereport-EXM108_FHIR4-8.2.000-denom.json │ │ │ ├── measurereport-EXM108_FHIR4-8.2.000-numer.json │ │ │ ├── tests-denom-EXM108_FHIR4-bundle.json │ │ │ ├── tests-numer-EXM108_FHIR4-bundle.json │ │ │ └── valuesets-EXM108_FHIR4-8.2.000-bundle.json │ ├── EXM124_FHIR4-8.2.000 │ │ ├── EXM124_FHIR4-8.2.000-bundle.json │ │ └── EXM124_FHIR4-8.2.000-files │ │ │ ├── EXM124_FHIR4-8.2.000.cql │ │ │ ├── library-EXM124_FHIR4-8.2.000.json │ │ │ ├── library-deps-EXM124_FHIR4-8.2.000-bundle.json │ │ │ ├── measure-EXM124_FHIR4-8.2.000.json │ │ │ ├── measurereport-EXM124-FHIR4-8.2.000-denom.json │ │ │ ├── measurereport-EXM124-FHIR4-8.2.000-numer.json │ │ │ ├── tests-denom-EXM124_FHIR4-bundle.json │ │ │ ├── tests-numer-EXM124_FHIR4-bundle.json │ │ │ └── valuesets-EXM124_FHIR4-8.2.000-bundle.json │ ├── EXM125_FHIR4-7.2.000 │ │ ├── EXM125_FHIR4-7.2.000-bundle.json │ │ └── EXM125_FHIR4-7.2.000-files │ │ │ ├── EXM125_FHIR4-7.2.000.cql │ │ │ ├── library-EXM125_FHIR4-7.2.000.json │ │ │ ├── library-deps-EXM125_FHIR4-7.2.000-bundle.json │ │ │ ├── measure-EXM125_FHIR4-7.2.000.json │ │ │ ├── measurereport-EXM125-FHIR4-7.2.000-denom.json │ │ │ ├── measurereport-EXM125-FHIR4-7.2.000-numer.json │ │ │ ├── tests-denom-EXM125_FHIR4-bundle.json │ │ │ ├── tests-numer-EXM125_FHIR4-bundle.json │ │ │ └── valuesets-EXM125_FHIR4-7.2.000-bundle.json │ ├── EXM130_FHIR4-7.2.000 │ │ ├── EXM130_FHIR4-7.2.000-bundle.json │ │ └── EXM130_FHIR4-7.2.000-files │ │ │ ├── EXM130_FHIR4-7.2.000.cql │ │ │ ├── library-EXM130_FHIR4-7.2.000.json │ │ │ ├── library-deps-EXM130_FHIR4-7.2.000-bundle.json │ │ │ ├── measure-EXM130_FHIR4-7.2.000.json │ │ │ ├── measurereport-EXM130-FHIR4-7.2.000-denom.json │ │ │ ├── measurereport-EXM130-FHIR4-7.2.000-numer.json │ │ │ ├── tests-denom-EXM130_FHIR4-bundle.json │ │ │ ├── tests-numer-EXM130_FHIR4-bundle.json │ │ │ └── valuesets-EXM130_FHIR4-7.2.000-bundle.json │ └── EXM506_FHIR4-2.1.000 │ │ ├── EXM506_FHIR4-2.1.000-bundle.json │ │ └── EXM506_FHIR4-2.1.000-files │ │ ├── EXM506_FHIR4-2.1.000.cql │ │ ├── library-EXM506_FHIR4-2.1.000.json │ │ ├── library-deps-EXM506_FHIR4-2.1.000-bundle.json │ │ ├── measure-EXM506_FHIR4-2.1.000.json │ │ ├── tests-denex1-EXM506_FHIR4-bundle.json │ │ ├── tests-denex2-EXM506_FHIR4-bundle.json │ │ ├── tests-denom-EXM506_FHIR4-bundle.json │ │ ├── tests-numer-EXM506_FHIR4-bundle.json │ │ └── valuesets-EXM506_FHIR4-2.1.000-bundle.json │ └── fhir401 │ └── EXM124-9.0.000 │ ├── EXM124-9.0.000-bundle.json │ └── EXM124-9.0.000-files │ ├── EXM124-9.0.000.cql │ ├── library-EXM124-9.0.000.json │ ├── library-deps-EXM124-9.0.000-bundle.json │ ├── measure-EXM124-9.0.000.json │ ├── measurereport-denom-EXM124-9.2.000-expectedresults.json │ ├── measurereport-denomexcl-EXM124-9.2.000-expectedresults.json │ ├── measurereport-numer-EXM124-9.2.000-expectedresults.json │ ├── tests-denom-EXM124-bundle.json │ ├── tests-denomexcl-EXM124-bundle.json │ ├── tests-numer-EXM124-bundle.json │ └── valuesets-EXM124-9.0.000-bundle.json ├── ig.json ├── instance-template-base.html ├── instance-template-example.html ├── instance-template-format.html ├── instance-template-sd-definitions.html ├── instance-template-sd-mappings.html ├── instance-template-sd.html ├── instance-template-valueset.html ├── org.hl7.fhir.publisher.jar ├── package-list.json ├── pages ├── _includes │ ├── container-end.html │ ├── container-start.html │ ├── footer.html │ ├── header.html │ └── navbar.html ├── _layouts │ └── default.html ├── assets │ ├── css │ │ ├── bootstrap-fhir.css │ │ ├── bootstrap-glyphicons.css │ │ ├── project.css │ │ ├── pygments-manni.css │ │ └── xml.css │ ├── fonts │ │ ├── glyphiconshalflings-regular.eot │ │ ├── glyphiconshalflings-regular.otf │ │ ├── glyphiconshalflings-regular.svg │ │ ├── glyphiconshalflings-regular.ttf │ │ └── glyphiconshalflings-regular.woff │ ├── ico │ │ ├── apple-touch-icon-114-precomposed.png │ │ ├── apple-touch-icon-144-precomposed.png │ │ ├── apple-touch-icon-57-precomposed.png │ │ ├── apple-touch-icon-72-precomposed.png │ │ ├── favicon.ico │ │ └── favicon.png │ ├── images │ │ ├── CQLBasedIG.png │ │ ├── CVVenn.jpg │ │ ├── CalculationFlowDiagrams-ContinuousVariable.jpg │ │ ├── CalculationFlowDiagrams-Proportion.jpg │ │ ├── CalculationFlowDiagrams-Ratio.jpg │ │ ├── CohortVenn.jpg │ │ ├── HQMF-structure.png │ │ ├── HQMFWithLinkedExpression.jpg │ │ ├── ProportionVenn.jpg │ │ ├── PublicHealtheMeasureFramework.jpg │ │ ├── QDMBasedIG.png │ │ ├── QDMElementStructure.png │ │ ├── Ratio2Venn.png │ │ ├── Ratio3Venn.png │ │ ├── RatioVenn.jpg │ │ ├── RelationshipToCQLBasedHQMFIG.png │ │ ├── RelationshipVolumes.png │ │ ├── cql-logo.png │ │ ├── data-model-standards-landscape.png │ │ ├── eMeasureQualityLifeCycle.jpg │ │ ├── fhir-logo-www.png │ │ ├── fhir-logo.png │ │ ├── hl7-logo.png │ │ ├── logo_ansinew.jpg │ │ ├── ncqa-logo.png │ │ ├── quality-improvement-ecosystem.png │ │ ├── quality-measurement-standards-landscape.png │ │ ├── search.png │ │ ├── stripe.png │ │ └── target.png │ └── js │ │ ├── fhir.js │ │ ├── html5shiv.js │ │ ├── jquery-1.11.1.min.map │ │ ├── jquery.js │ │ ├── respond.min.js │ │ └── xml.js ├── cql │ ├── complete │ │ ├── fhir2 │ │ │ ├── FHIRHelpers-1.0.2.cql │ │ │ └── SupplementalDataElements_FHIR2-1.0.0.cql │ │ ├── fhir3 │ │ │ ├── AdultOutpatientEncounters_FHIR3-1.1.000.cql │ │ │ ├── EXM108_FHIR3-7.4.000.cql │ │ │ ├── EXM124_FHIR3-7.2.000.cql │ │ │ ├── EXM125_FHIR3-7.2.000.cql │ │ │ ├── EXM130_FHIR3-7.2.000.cql │ │ │ ├── FHIRHelpers-3.0.0.cql │ │ │ ├── Hospice_FHIR3-1.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_FHIR3-2.0.000.cql │ │ │ ├── SupplementalDataElements_FHIR3-1.0.0.cql │ │ │ └── VTEICU_FHIR3-2.4.000.cql │ │ ├── fhir4 │ │ │ ├── AdultOutpatientEncounters_FHIR4-1.1.000.cql │ │ │ ├── EXM349_FHIR4-2.9.000.cql │ │ │ ├── FHIRHelpers-4.0.0.cql │ │ │ ├── Hospice_FHIR4-1.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_FHIR4-4.0.000.cql │ │ │ ├── SupplementalDataElements_FHIR4-1.0.0.cql │ │ │ ├── TJCOverall_FHIR4-4.0.000.cql │ │ │ └── VTEICU_FHIR4-3.1.000.cql │ │ └── fhir401 │ │ │ ├── AdultOutpatientEncounters-2.0.000.cql │ │ │ ├── EXM111-9.1.000.cql │ │ │ ├── EXM127-9.2.000.cql │ │ │ ├── EXM153-9.2.000.cql │ │ │ ├── EXM529-1.0.000.cql │ │ │ ├── EXM74-10.2.000.cql │ │ │ ├── FHIRHelpers-4.0.1.cql │ │ │ ├── Hospice-2.0.000.cql │ │ │ ├── MATGlobalCommonFunctions-5.0.000.cql │ │ │ └── SupplementalDataElements-2.0.0.cql │ ├── in-progress │ │ ├── fhir2 │ │ │ ├── FHIRHelpers-1.0.2.cql │ │ │ └── SupplementalDataElements_FHIR2-1.0.0.cql │ │ ├── fhir3 │ │ │ ├── AdultOutpatientEncounters_FHIR3-1.1.000.cql │ │ │ ├── AdvancedIllnessandFrailtyExclusion_FHIR3-4.0.000.cql │ │ │ ├── DayMonthTimings-0.9.000.cql │ │ │ ├── EXM104_FHIR3-8.1.000.cql │ │ │ ├── EXM105_FHIR3-7.0.0.cql │ │ │ ├── EXM105_FHIR3-8.000.cql │ │ │ ├── EXM111_FHIR3-8.0.000.cql │ │ │ ├── EXM117_FHIR3-1.0.1.cql │ │ │ ├── EXM135_FHIR3.cql │ │ │ ├── EXM146_FHIR3-4.0.0.cql │ │ │ ├── EXM159_FHIR3-8.5.002.cql │ │ │ ├── EXM161_FHIR3-8.0.0.cql │ │ │ ├── EXM165_FHIR3-8.5.000.cql │ │ │ ├── EXM177_FHIR3-8.1.000.cql │ │ │ ├── EXM2_FHIR3-1.1.000.cql │ │ │ ├── EXM349_FHIR3-2.9.000.cql │ │ │ ├── EXM506_FHIR3-1.3.000.cql │ │ │ ├── EXM506_FHIR3-2.0.000.cql │ │ │ ├── EXM68_FHIR3-9.1.000.cql │ │ │ ├── EXM71_FHIR3-9.1.000.cql │ │ │ ├── EXM72_FHIR3-8.1.0.cql │ │ │ ├── FHIRHelpers-3.0.0.cql │ │ │ ├── Hospice_FHIR3-1.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_FHIR3-2.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_FHIR3-4.0.000.cql │ │ │ ├── OpioidConversion-1.21.000.cql │ │ │ ├── OpioidData-0.9.000.cql │ │ │ ├── PotentialOpioidOveruse_FHIR3-0.1.082.cql │ │ │ ├── PotentialOpioidOveruse_QDM5-0.1.082.cql │ │ │ ├── RheumatoidArthritisRADraftMeasure_FHIR3-0.0.004.cql │ │ │ ├── SupplementalDataElements_FHIR3-1.0.0.cql │ │ │ ├── TJCOverall_FHIR3-1.4.000.cql │ │ │ ├── TJCOverall_FHIR3-3.6.000.cql │ │ │ ├── TJC_Overall_QDM5-1.4.000.cql │ │ │ └── VTEICU_FHIR3-3.1.000.cql │ │ ├── fhir4 │ │ │ ├── AdultOutpatientEncounters_FHIR4-1.1.000.cql │ │ │ ├── AdvancedIllnessandFrailtyExclusion_FHIR4-4.0.000.cql │ │ │ ├── CoreClinicalDataElementsfortheHybridHospitalWideReadmissionHWRMeasurewithClaimsandElectronicHealthRecordData-0.2.031.cql │ │ │ ├── EXM111_FHIR4-8.0.000.cql │ │ │ ├── EXM113_FHIR4-8.1.000.cql │ │ │ ├── EXM165_FHIR4-8.5.000.cql │ │ │ ├── EXM190_FHIR4-8.2.000.cql │ │ │ ├── EXM349_FHIR4-2.9.000.cql │ │ │ ├── EXM506_FHIR4-2.0.000.cql │ │ │ ├── EXM71_FHIR4-9.000.cql │ │ │ ├── EXM72_FHIR4-8.1.000.cql │ │ │ ├── EXM9_FHIR4-8.1.000.cql │ │ │ ├── FHIRHelpers-4.0.0.cql │ │ │ ├── Hospice_FHIR4-1.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_FHIR4-4.0.000.cql │ │ │ ├── SupplementalDataElements_FHIR4-1.0.0.cql │ │ │ ├── TJCOverall_FHIR4-4.0.000.cql │ │ │ └── VTEICU_FHIR4-3.1.000.cql │ │ ├── fhir401 │ │ │ ├── AdultOutpatientEncounters_FHIR4-2.0.000.cql │ │ │ ├── AdvancedIllnessandFrailtyExclusion_FHIR4-5.0.000.cql │ │ │ ├── EXM117_FHIR4-9.2.000.cql │ │ │ ├── EXM122_FHIR4-9.3.000.cql │ │ │ ├── EXM125_FHIR4-9.1.000.cql │ │ │ ├── EXM128_FHIR4-9.2.000.cql │ │ │ ├── EXM130_FHIR4-9.2.000.cql │ │ │ ├── EXM131_FHIR4-9.1.000.cql │ │ │ ├── EXM134_FHIR4-9.3.000.cql │ │ │ ├── EXM136_FHIR4-10.2.000.cql │ │ │ ├── EXM137_FHIR4-9.3.000.cql │ │ │ ├── EXM138_FHIR4-9.2.000.cql │ │ │ ├── EXM139_FHIR4-9.1.000.cql │ │ │ ├── EXM147_FHIR4-9.1.000.cql │ │ │ ├── EXM149-9.2.000.cql │ │ │ ├── EXM154_FHIR4-9.2.000.cql │ │ │ ├── EXM155_FHIR4-9.2.000.cql │ │ │ ├── EXM156_FHIR4-8.3.000.cql │ │ │ ├── EXM165_FHIR4-9.2.000.cql │ │ │ ├── EXM249_FHIR4-3.3.cql │ │ │ ├── EXM347_FHIR4-4.3.000.cql │ │ │ ├── EXM529-1.3.000.cql │ │ │ ├── EXM56_FHIR4-9.2.000.cql │ │ │ ├── EXM66_FHIR4-9.3.000.cql │ │ │ ├── EXM75_FHIR4-9.2.000.cql │ │ │ ├── EXM90_FHIR4-10.2.000.cql │ │ │ ├── Hospice_FHIR4-2.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_FHIR4-5.0.000.cql │ │ │ ├── NCQA_Common-5.1.cql │ │ │ ├── NCQA_Common-5.2.000.cql │ │ │ ├── PalliativeCareHEDIS_FHIR4-0.1.000.cql │ │ │ ├── SupplementalDataElements_FHIR4-2.0.0.cql │ │ │ ├── TJCOverall_FHIR4-5.0.000.cql │ │ │ ├── TerminologyGuidance.cql │ │ │ └── test.cql │ │ └── qicore │ │ │ ├── AdultOutpatientEncounters_QICore4-2.0.000.cql │ │ │ ├── AdvancedIllnessandFrailtyExclusion_QICore4-5.0.000.cql │ │ │ ├── EXM124_QICore4-8.2.000.cql │ │ │ ├── EXM165_QICore4-8.5.000.cql │ │ │ ├── Hospice_QICore4-2.0.000.cql │ │ │ ├── MATGlobalCommonFunctions_QICore4-5.0.000.cql │ │ │ ├── SupplementalDataElements_QICore4-2.0.0.cql │ │ │ ├── TJCOverall_QICore4-5.0.000.cql │ │ │ └── VTEICU_QICore4-4.0.000.cql │ └── release │ │ ├── fhir4 │ │ ├── AdultOutpatientEncounters_FHIR4-1.1.000.cql │ │ ├── EXM104_FHIR4-8.1.000.cql │ │ ├── EXM105_FHIR4-8.1.000.cql │ │ ├── EXM108_FHIR4-8.2.000.cql │ │ ├── EXM124_FHIR4-8.2.000.cql │ │ ├── EXM125_FHIR4-7.2.000.cql │ │ ├── EXM130_FHIR4-7.2.000.cql │ │ ├── EXM506_FHIR4-2.1.000.cql │ │ ├── FHIRHelpers-4.0.0.cql │ │ ├── Hospice_FHIR4-1.0.000.cql │ │ ├── MATGlobalCommonFunctions_FHIR4-4.0.000.cql │ │ ├── SupplementalDataElements_FHIR4-1.0.0.cql │ │ ├── TJCOverall_FHIR4-4.0.000.cql │ │ └── VTEICU_FHIR4-3.1.000.cql │ │ └── fhir401 │ │ ├── AdultOutpatientEncounters-2.0.000.cql │ │ ├── EXM124-9.0.000.cql │ │ ├── FHIRHelpers-4.0.1.cql │ │ ├── Hospice-2.0.000.cql │ │ ├── MATGlobalCommonFunctions-5.0.000.cql │ │ └── SupplementalDataElements-2.0.0.cql ├── dist │ ├── css │ │ └── bootstrap.css │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── downloads.html ├── elm │ ├── AdultOutpatientEncounters_FHIR-1.1.000.xml │ ├── AdultOutpatientEncounters_QDM-1.1.000.xml │ ├── FHIRHelpers-3.0.0.xml │ ├── Hospice_FHIR-1.0.000.xml │ ├── Hospice_QDM-1.0.000.xml │ ├── MATGlobalCommonFunctions_FHIR-2.0.000.xml │ ├── MATGlobalCommonFunctions_QDM-2.0.000.xml │ ├── cms124_FHIR-7.2.000.xml │ ├── cms124_QDM-7.2.000.xml │ ├── cms125_FHIR-7.2.000.xml │ ├── cms125_QDM-7.2.000.xml │ ├── cms130_FHIR-7.2.000.xml │ ├── cms130_QDM-7.2.000.xml │ └── exm-logic-1.0.0.xml ├── examples.md ├── history.md ├── index.html ├── jquery-1.11.1.js ├── jquery-1.11.1.min.js ├── jquery-ui.css ├── jquery-ui.js ├── jquery-ui.min.css ├── jquery-ui.min.js ├── jquery-ui.structure.css ├── jquery-ui.structure.min.css ├── jquery-ui.theme.css ├── jquery-ui.theme.min.css ├── jquery.js ├── libraries.html ├── measure-test-patients.html ├── measures.html ├── registry.html ├── terminology.html └── test-data.html └── resources ├── draft-measures-profile-introduction.xml ├── draft-profile-notes.xml ├── draftmeasures.xml ├── library ├── library-adult-outpatient-encounters-FHIR.json ├── library-adult-outpatient-encounters-QDM.json ├── library-exm124-FHIR.json ├── library-exm125-FHIR.json ├── library-exm130-FHIR.json ├── library-fhir-helpers-FHIR2.json ├── library-fhir-helpers.json ├── library-fhir-model-definition-FHIR2.json ├── library-fhir-model-definition.json ├── library-hospice-FHIR.json ├── library-hospice-QDM.json ├── library-mat-global-common-functions-FHIR.json ├── library-mat-global-common-functions-QDM.json ├── library-supplemental-data-elements-FHIR.json ├── library-supplemental-data-elements-FHIR2.json ├── library-vte-1-FHIR.json └── library-vte-icu-FHIR.json └── measure ├── measure-exm124-FHIR.json ├── measure-exm125-FHIR.json ├── measure-exm130-FHIR.json └── measure-vte-1-FHIR.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | /output 3 | /qa 4 | /temp 5 | /.idea 6 | /.vscode 7 | /txCache 8 | /ig.ini 9 | /resources/ig-expansion-parameters.json 10 | /resources/ig-new.json 11 | /resources/ig-new.xml 12 | /resources/ig-validation-parameters.json 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | jdk: oraclejdk8 3 | rvm: 2.2 4 | before_install: gem install jekyll 5 | script: ant -buildfile build.xml travis-publish-ig -Dguidename=cqfmeasures -Dspec=http://hl7-fhir.github.io/ 6 | -------------------------------------------------------------------------------- /FHIR Measure Test Cases TEMPLATE.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/FHIR Measure Test Cases TEMPLATE.xlsx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Draft Measures 2 | 3 | This implementation guide provides draft measure content. Measures in this implementation guide are examples and works in progress and should not be considered final specifications or recommendations for clinical guidance. These examples will help guide and direct the process of finding conventions and usage patterns that meet the needs of the various stakeholders in the measure development community. 4 | 5 | Commits to this repository will automatically trigger a new build of the IG, which will then be published to the following location: 6 | 7 | [http://build.fhir.org/ig/cqframework/draft-measures](http://build.fhir.org/ig/cqframework/draft-measures) 8 | 9 | Build log is available here: 10 | [http://ig-build.fhir.org.s3-website-us-east-1.amazonaws.com/logs/cqframework/draft-measures](http://ig-build.fhir.org.s3-website-us-east-1.amazonaws.com/logs/cqframework/draft-measures) 11 | 12 | Full debugging information is available here: 13 | [http://build.fhir.org/ig/cqframework/draft-measures/debug.tgz](http://build.fhir.org/ig/cqframework/draft-measures/debug.tgz) 14 | 15 | ## Local Build 16 | 17 | The HL7 IG Publisher is committed to this repository to make building as easy as possible. To build locally, clone the repository and issue the following command in the root: 18 | 19 | java -jar "org.hl7.fhir.publisher.jar" -ig ig.json 20 | 21 | ## Dependencies 22 | 23 | Before the instructions in the above "Local Build" section will work, you 24 | need to install several primary dependencies. 25 | 26 | ### Java 27 | 28 | Go to [http://www.oracle.com/technetwork/java/javase/downloads/]( 29 | http://www.oracle.com/technetwork/java/javase/downloads/) and download the 30 | latest (version 8 or higher) JDK for your platform, and install it. 31 | 32 | ### Ruby 33 | 34 | Jekyll requires Ruby version 2.1 or greater. Depending on your operating 35 | system, you may already have Ruby bundled with it. Otherwise, or if you 36 | need a newer version, go to [https://www.ruby-lang.org/en/downloads/]( 37 | https://www.ruby-lang.org/en/downloads/) for directions. 38 | 39 | ### Jekyll 40 | 41 | Go to [https://jekyllrb.com](https://jekyllrb.com) and follow the 42 | instructions there, for example `gem install jekyll bundler`. The end 43 | result of this should be that the binary "jekyll" is now in your path. 44 | -------------------------------------------------------------------------------- /_runant.bat: -------------------------------------------------------------------------------- 1 | SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 2 | call ant -buildfile build.xml -Dguidename=cqfmeasures -Dspec=http://hl7.org/fhir/ 3 | pause -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /bundles/release/fhir401/EXM124-9.0.000/EXM124-9.0.000-files/EXM124-9.0.000.cql: -------------------------------------------------------------------------------- 1 | library EXM124 version '9.0.000' 2 | 3 | 4 | /* 5 | Based on CMS124v7 - Cervical Cancer Screening 6 | */ 7 | 8 | /* 9 | This example is a work in progress and should not be considered a final specification 10 | or recommendation for guidance. This example will help guide and direct the process 11 | of finding conventions and usage patterns that meet the needs of the various stakeholders 12 | in the measure development community. 13 | */ 14 | 15 | using FHIR version '4.0.1' 16 | 17 | include FHIRHelpers version '4.0.1' called FHIRHelpers 18 | include Hospice version '2.0.000' called Hospice 19 | include AdultOutpatientEncounters version '2.0.000' called AdultOutpatientEncounters 20 | include MATGlobalCommonFunctions version '5.0.000' called Global 21 | include SupplementalDataElements version '2.0.0' called SDE 22 | 23 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 24 | 25 | valueset "Hysterectomy with No Residual Cervix": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1014' 26 | valueset "Pap Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1017' 27 | valueset "HPV Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1059' 28 | 29 | code "Congenital absence of cervix (disorder)": '37687000' from "SNOMEDCT:2017-09" display 'Congenital absence of cervix (disorder)' 30 | 31 | parameter "Measurement Period" Interval 32 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 33 | 34 | context Patient 35 | 36 | define "SDE Ethnicity": 37 | SDE."SDE Ethnicity" 38 | 39 | define "SDE Payer": 40 | SDE."SDE Payer" 41 | 42 | define "SDE Race": 43 | SDE."SDE Race" 44 | 45 | define "SDE Sex": 46 | SDE."SDE Sex" 47 | 48 | define "Initial Population": 49 | Patient.gender = 'female' 50 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period") in Interval[23, 64] 51 | and exists AdultOutpatientEncounters."Qualifying Encounters" 52 | 53 | define "Denominator": 54 | "Initial Population" 55 | 56 | define "Denominator Exclusion": 57 | Hospice."Has Hospice" 58 | or exists "Absence of Cervix" 59 | 60 | define "Absence of Cervix": 61 | ([Procedure: "Hysterectomy with No Residual Cervix"] NoCervixProcedure 62 | where Global."Normalize Interval"(NoCervixProcedure.performed) ends on or before end of "Measurement Period" 63 | and NoCervixProcedure.status = 'completed' 64 | ) 65 | union [Condition : "Congenital absence of cervix (disorder)"] NoCervixBirth 66 | where Global."Normalize Interval"(NoCervixBirth.onset) starts on or before end of "Measurement Period" 67 | // and NoCervixBirth.clinicalStatus ~ ToConcept(Global."active") because this is an excluion, all statuses are acceptable 68 | 69 | define "Numerator": 70 | exists "Cervical Cytology Within 3 Years" 71 | or exists "HPV Test Within 5 Years for Women Age 30 and Older" 72 | 73 | define "Cervical Cytology Within 3 Years": 74 | [Observation: "Pap Test"] CervicalCytology 75 | where CervicalCytology.value is not null 76 | and CervicalCytology.status in { 'final', 'amended', 'corrected', 'preliminary' } 77 | and Global."Normalize Interval"(CervicalCytology.effective) ends 3 years or less on or before end of "Measurement Period" 78 | 79 | define "HPV Test Within 5 Years for Women Age 30 and Older": 80 | [Observation: "HPV Test"] HPVTest 81 | where HPVTest.value is not null 82 | and HPVTest.status in { 'final', 'amended', 'corrected', 'preliminary' } 83 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of Global."Normalize Interval"(HPVTest.effective))>= 30 84 | and Global."Normalize Interval"(HPVTest.effective) ends 5 years or less on or before end of "Measurement Period" 85 | -------------------------------------------------------------------------------- /instance-template-base.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 |

{{[type]}}-{{[id]}}

10 | 11 |

12 | Formats: XML, JSON, Turtle 13 |

14 | 15 | {% include {{[type]}}-{{[name]}}.xhtml %} 16 | 17 | {% include container-end.html %} 18 | 19 | {% include footer.html %} -------------------------------------------------------------------------------- /instance-template-example.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 |

Example: {{[type]}}-{{[id]}}

10 | 11 |

12 | Formats: XML, JSON, Turtle 13 |

14 | 15 | {% include {{[type]}}-{{[name]}}.xhtml %} 16 | 17 | {% include container-end.html %} 18 | 19 | {% include footer.html %} -------------------------------------------------------------------------------- /instance-template-format.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 |

{{[title]}}

10 | 11 | {% include {{[type]}}-{{[name]}}.xhtml %} 12 | 13 | {% include container-end.html %} 14 | 15 | {% include footer.html %} -------------------------------------------------------------------------------- /instance-template-sd-definitions.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | 17 | 18 |

19 | D.4.1.4 StructureDefinition: {{[id]}} - Detailed Descriptions 20 | 21 | 22 | 23 |

24 | 25 |

Definitions for the {{[type]}}-{{[id]}} Profile.

26 | 27 | {% include {{[type]}}-{{[id]}}-dict.xhtml %} 28 | 29 | {% include container-end.html %} 30 | 31 | {% include footer.html %} -------------------------------------------------------------------------------- /instance-template-sd-mappings.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | 17 | 18 |

19 | D.4.1.4 StructureDefinition: {{[id]}} - Mappings 20 | 21 | 22 | 23 |

24 | 25 |

Mappings for the {{[type]}}-{{[id]}} Profile.

26 | 27 | {% include {{[type]}}-{{[id]}}-maps.xhtml %} 28 | 29 | {% include container-end.html %} 30 | 31 | {% include footer.html %} -------------------------------------------------------------------------------- /instance-template-valueset.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 |

Valueset: {{[id]}}

10 | 11 | {% include {{[type]}}-{{[id]}}-summary.xhtml %} 12 | 13 | This value set is used by: 14 | 15 | {% include {{[type]}}-{{[id]}}-xref.xhtml %} 16 | 17 | {% include {{[type]}}-{{[id]}}-cld.xhtml %} 18 | 19 |

Expansion

20 | 21 | {% include {{[type]}}-{{[id]}}-expansion.xhtml %} 22 | 23 | {% include footer.html %} -------------------------------------------------------------------------------- /org.hl7.fhir.publisher.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/org.hl7.fhir.publisher.jar -------------------------------------------------------------------------------- /package-list.json: -------------------------------------------------------------------------------- 1 | { 2 | "package-id": "hl7.fhir.us.draftmeasures", 3 | "title": "Clinical Quality Framework Draft Measure Content", 4 | "canonical": "http://hl7.org/fhir/us/draftmeasures", 5 | "introduction": "This implementation guide provides draft measure content. Measures in this implementation guide are examples and works in progress and should not be considered final specifications or recommendations for clinical guidance. These examples will help guide and direct the process of finding conventions and usage patterns that meet the needs of the various stakeholders in the measure development community.", 6 | "list": [ 7 | { 8 | "version": "current", 9 | "desc": "Continuous Integration Build for FHIR STU3 (latest in version control)", 10 | "path": "http://build.fhir.org/ig/HL7/draftmeasures", 11 | "status": "ci-build", 12 | "current": true 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /pages/_includes/container-end.html: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pages/_includes/container-start.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 | 16 |
-------------------------------------------------------------------------------- /pages/_includes/footer.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | -------------------------------------------------------------------------------- /pages/_includes/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Draft Measures 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | {% include navbar.html %} -------------------------------------------------------------------------------- /pages/_includes/navbar.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | Draft Measures 6 |
7 | 8 |
9 | 12 |
13 | 14 |
15 |
16 |
17 | 18 |
19 |
20 | 21 | 22 | 42 | 43 | 44 |
45 |
46 | -------------------------------------------------------------------------------- /pages/_layouts/default.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | {% include header.html %} 5 | {% include container-start.html %} 6 | 7 | {{ content }} 8 | 9 | {% include container-end.html %} 10 | {% include footer.html %} 11 | -------------------------------------------------------------------------------- /pages/assets/css/pygments-manni.css: -------------------------------------------------------------------------------- 1 | .hll { background-color: #ffffcc } 2 | /*{ background: #f0f3f3; }*/ 3 | .c { color: #999; } /* Comment */ 4 | .err { color: #AA0000; background-color: #FFAAAA } /* Error */ 5 | .k { color: #006699; } /* Keyword */ 6 | .o { color: #555555 } /* Operator */ 7 | .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ 8 | .cp { color: #009999 } /* Comment.Preproc */ 9 | .c1 { color: #999; } /* Comment.Single */ 10 | .cs { color: #999; } /* Comment.Special */ 11 | .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ 12 | .ge { font-style: italic } /* Generic.Emph */ 13 | .gr { color: #FF0000 } /* Generic.Error */ 14 | .gh { color: #003300; } /* Generic.Heading */ 15 | .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ 16 | .go { color: #AAAAAA } /* Generic.Output */ 17 | .gp { color: #000099; } /* Generic.Prompt */ 18 | .gs { } /* Generic.Strong */ 19 | .gu { color: #003300; } /* Generic.Subheading */ 20 | .gt { color: #99CC66 } /* Generic.Traceback */ 21 | .kc { color: #006699; } /* Keyword.Constant */ 22 | .kd { color: #006699; } /* Keyword.Declaration */ 23 | .kn { color: #006699; } /* Keyword.Namespace */ 24 | .kp { color: #006699 } /* Keyword.Pseudo */ 25 | .kr { color: #006699; } /* Keyword.Reserved */ 26 | .kt { color: #007788; } /* Keyword.Type */ 27 | .m { color: #FF6600 } /* Literal.Number */ 28 | .s { color: #d44950 } /* Literal.String */ 29 | .na { color: #4f9fcf } /* Name.Attribute */ 30 | .nb { color: #336666 } /* Name.Builtin */ 31 | .nc { color: #00AA88; } /* Name.Class */ 32 | .no { color: #336600 } /* Name.Constant */ 33 | .nd { color: #9999FF } /* Name.Decorator */ 34 | .ni { color: #999999; } /* Name.Entity */ 35 | .ne { color: #CC0000; } /* Name.Exception */ 36 | .nf { color: #CC00FF } /* Name.Function */ 37 | .nl { color: #9999FF } /* Name.Label */ 38 | .nn { color: #00CCFF; } /* Name.Namespace */ 39 | .nt { color: #2f6f9f; } /* Name.Tag */ 40 | .nv { color: #003333 } /* Name.Variable */ 41 | .ow { color: #000000; } /* Operator.Word */ 42 | .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .mf { color: #FF6600 } /* Literal.Number.Float */ 44 | .mh { color: #FF6600 } /* Literal.Number.Hex */ 45 | .mi { color: #FF6600 } /* Literal.Number.Integer */ 46 | .mo { color: #FF6600 } /* Literal.Number.Oct */ 47 | .sb { color: #CC3300 } /* Literal.String.Backtick */ 48 | .sc { color: #CC3300 } /* Literal.String.Char */ 49 | .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ 50 | .s2 { color: #CC3300 } /* Literal.String.Double */ 51 | .se { color: #CC3300; } /* Literal.String.Escape */ 52 | .sh { color: #CC3300 } /* Literal.String.Heredoc */ 53 | .si { color: #AA0000 } /* Literal.String.Interpol */ 54 | .sx { color: #CC3300 } /* Literal.String.Other */ 55 | .sr { color: #33AAAA } /* Literal.String.Regex */ 56 | .s1 { color: #CC3300 } /* Literal.String.Single */ 57 | .ss { color: #FFCC33 } /* Literal.String.Symbol */ 58 | .bp { color: #336666 } /* Name.Builtin.Pseudo */ 59 | .vc { color: #003333 } /* Name.Variable.Class */ 60 | .vg { color: #003333 } /* Name.Variable.Global */ 61 | .vi { color: #003333 } /* Name.Variable.Instance */ 62 | .il { color: #FF6600 } /* Literal.Number.Integer.Long */ 63 | 64 | .css .o, 65 | .css .o + .nt, 66 | .css .nt + .nt { color: #999; } 67 | -------------------------------------------------------------------------------- /pages/assets/css/xml.css: -------------------------------------------------------------------------------- 1 | 2 | pre code{display:block;padding:.5em;background:white;color:black}pre .comment,pre .template_comment,pre .javadoc,pre .comment *{color:#800}pre .keyword,pre .method,pre .list .title,pre .clojure .built_in,pre .nginx .title,pre .tag .title,pre .setting .value,pre .winutils,pre .tex .command,pre .http .title,pre .request,pre .status{color:#008}pre .envvar,pre .tex .special{color:#660}pre .string,pre .tag .value,pre .cdata,pre .filter .argument,pre .attr_selector,pre .apache .cbracket,pre .date,pre .regexp{color:#080}pre .sub .identifier,pre .pi,pre .tag,pre .tag .keyword,pre .decorator,pre .ini .title,pre .shebang,pre .prompt,pre .hexcolor,pre .rules .value,pre .css .value .number,pre .literal,pre .symbol,pre .ruby .symbol .string,pre .number,pre .css .function,pre .clojure .attribute{color:#066}pre .class .title,pre .haskell .type,pre .smalltalk .class,pre .javadoctag,pre .yardoctag,pre .phpdoc,pre .typename,pre .tag .attribute,pre .doctype,pre .class .id,pre .built_in,pre .setting,pre .params,pre .variable,pre .clojure .title{color:#606}pre .css .tag,pre .rules .property,pre .pseudo,pre .subst{color:#000}pre .css .class,pre .css .id{color:#9b703f}pre .value .important{color:#f70;font-weight:bold}pre .rules .keyword{color:#c5af75}pre .annotation,pre .apache .sqbracket,pre .nginx .built_in{color:#9b859d}pre .preprocessor,pre .preprocessor *{color:#444}pre .tex .formula{background-color:#EEE;font-style:italic}pre .diff .header,pre .chunk{color:#808080;font-weight:bold}pre .diff .change{background-color:#bccff9}pre .addition{background-color:#baeeba}pre .deletion{background-color:#ffc8bd}pre .comment .yardoctag{font-weight:bold} 3 | -------------------------------------------------------------------------------- /pages/assets/fonts/glyphiconshalflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/fonts/glyphiconshalflings-regular.eot -------------------------------------------------------------------------------- /pages/assets/fonts/glyphiconshalflings-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/fonts/glyphiconshalflings-regular.otf -------------------------------------------------------------------------------- /pages/assets/fonts/glyphiconshalflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/fonts/glyphiconshalflings-regular.ttf -------------------------------------------------------------------------------- /pages/assets/fonts/glyphiconshalflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/fonts/glyphiconshalflings-regular.woff -------------------------------------------------------------------------------- /pages/assets/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /pages/assets/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /pages/assets/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /pages/assets/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /pages/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/ico/favicon.ico -------------------------------------------------------------------------------- /pages/assets/ico/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/ico/favicon.png -------------------------------------------------------------------------------- /pages/assets/images/CQLBasedIG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/CQLBasedIG.png -------------------------------------------------------------------------------- /pages/assets/images/CVVenn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/CVVenn.jpg -------------------------------------------------------------------------------- /pages/assets/images/CalculationFlowDiagrams-ContinuousVariable.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/CalculationFlowDiagrams-ContinuousVariable.jpg -------------------------------------------------------------------------------- /pages/assets/images/CalculationFlowDiagrams-Proportion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/CalculationFlowDiagrams-Proportion.jpg -------------------------------------------------------------------------------- /pages/assets/images/CalculationFlowDiagrams-Ratio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/CalculationFlowDiagrams-Ratio.jpg -------------------------------------------------------------------------------- /pages/assets/images/CohortVenn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/CohortVenn.jpg -------------------------------------------------------------------------------- /pages/assets/images/HQMF-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/HQMF-structure.png -------------------------------------------------------------------------------- /pages/assets/images/HQMFWithLinkedExpression.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/HQMFWithLinkedExpression.jpg -------------------------------------------------------------------------------- /pages/assets/images/ProportionVenn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/ProportionVenn.jpg -------------------------------------------------------------------------------- /pages/assets/images/PublicHealtheMeasureFramework.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/PublicHealtheMeasureFramework.jpg -------------------------------------------------------------------------------- /pages/assets/images/QDMBasedIG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/QDMBasedIG.png -------------------------------------------------------------------------------- /pages/assets/images/QDMElementStructure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/QDMElementStructure.png -------------------------------------------------------------------------------- /pages/assets/images/Ratio2Venn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/Ratio2Venn.png -------------------------------------------------------------------------------- /pages/assets/images/Ratio3Venn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/Ratio3Venn.png -------------------------------------------------------------------------------- /pages/assets/images/RatioVenn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/RatioVenn.jpg -------------------------------------------------------------------------------- /pages/assets/images/RelationshipToCQLBasedHQMFIG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/RelationshipToCQLBasedHQMFIG.png -------------------------------------------------------------------------------- /pages/assets/images/RelationshipVolumes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/RelationshipVolumes.png -------------------------------------------------------------------------------- /pages/assets/images/cql-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/cql-logo.png -------------------------------------------------------------------------------- /pages/assets/images/data-model-standards-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/data-model-standards-landscape.png -------------------------------------------------------------------------------- /pages/assets/images/eMeasureQualityLifeCycle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/eMeasureQualityLifeCycle.jpg -------------------------------------------------------------------------------- /pages/assets/images/fhir-logo-www.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/fhir-logo-www.png -------------------------------------------------------------------------------- /pages/assets/images/fhir-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/fhir-logo.png -------------------------------------------------------------------------------- /pages/assets/images/hl7-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/hl7-logo.png -------------------------------------------------------------------------------- /pages/assets/images/logo_ansinew.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/logo_ansinew.jpg -------------------------------------------------------------------------------- /pages/assets/images/ncqa-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/ncqa-logo.png -------------------------------------------------------------------------------- /pages/assets/images/quality-improvement-ecosystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/quality-improvement-ecosystem.png -------------------------------------------------------------------------------- /pages/assets/images/quality-measurement-standards-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/quality-measurement-standards-landscape.png -------------------------------------------------------------------------------- /pages/assets/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/search.png -------------------------------------------------------------------------------- /pages/assets/images/stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/stripe.png -------------------------------------------------------------------------------- /pages/assets/images/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/assets/images/target.png -------------------------------------------------------------------------------- /pages/assets/js/fhir.js: -------------------------------------------------------------------------------- 1 | // IT'S ALL JUST FOR FHIR SITE! 2 | // ++++++++++++++++++++++++++++++++++++++++++ 3 | -------------------------------------------------------------------------------- /pages/assets/js/html5shiv.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); 8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d #mq-test-1 { width: 42px; }',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); 4 | 5 | /*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 6 | (function(a){"use strict";function x(){u(!0)}var b={};a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,b.mediaQueriesSupported;var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var a=m.shift();v(a.href,function(b){p(b,a.href,a.media),h[a.href]=!0,setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(a){var b="clientWidth",h=d[b],k="CSS1Compat"===c.compatMode&&h||c.body[b]||h,m={},n=l[l.length-1],o=(new Date).getTime();if(a&&q&&i>o-q)return clearTimeout(r),r=setTimeout(u,i),void 0;q=o;for(var p in e)if(e.hasOwnProperty(p)){var v=e[p],w=v.minw,x=v.maxw,y=null===w,z=null===x,A="em";w&&(w=parseFloat(w)*(w.indexOf(A)>-1?t||s():1)),x&&(x=parseFloat(x)*(x.indexOf(A)>-1?t||s():1)),v.hasquery&&(y&&z||!(y||k>=w)||!(z||x>=k))||(m[v.media]||(m[v.media]=[]),m[v.media].push(f[v.rules]))}for(var B in g)g.hasOwnProperty(B)&&g[B]&&g[B].parentNode===j&&j.removeChild(g[B]);for(var C in m)if(m.hasOwnProperty(C)){var D=c.createElement("style"),E=m[C].join("\n");D.type="text/css",D.media=C,j.insertBefore(D,n.nextSibling),D.styleSheet?D.styleSheet.cssText=E:D.appendChild(c.createTextNode(E)),g.push(D)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)})(this); 7 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir2/SupplementalDataElements_FHIR2-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR2 version '1.0.0' 2 | 3 | using FHIR version '1.0.2' 4 | 5 | include FHIRHelpers version '1.0.2' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://fhir.org/guides/argonaut/StructureDefinition/argo-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.valueCodeableConcept 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://fhir.org/guides/argonaut/StructureDefinition/argo-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.valueCodeableConcept 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir3/AdultOutpatientEncounters_FHIR3-1.1.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR3 version '1.1.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '3.0.0' 11 | 12 | include FHIRHelpers version '3.0.0' called FHIRHelpers 13 | 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 16 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 17 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 18 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 19 | 20 | context Patient 21 | 22 | define function "Qualifying Encounters"(MeasurementPeriod Interval): 23 | ( 24 | [Encounter: "Office Visit"] 25 | union [Encounter: "Annual Wellness Visit"] 26 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 27 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 28 | union [Encounter: "Home Healthcare Services"] 29 | ) ValidEncounter 30 | where ValidEncounter.period during day of MeasurementPeriod 31 | and ValidEncounter.status = 'finished' 32 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir3/Hospice_FHIR3-1.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR3 version '1.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '3.0.0' 11 | 12 | include MATGlobalCommonFunctions_FHIR3 version '2.0.000' called Global 13 | include FHIRHelpers version '3.0.0' called FHIRHelpers 14 | 15 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 16 | 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 19 | 20 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 21 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 22 | 23 | context Patient 24 | 25 | define function "Has Hospice"(MeasurementPeriod Interval): 26 | exists ( 27 | [Encounter: "Encounter Inpatient"] DischargeHospice 28 | where DischargeHospice.status = 'final' 29 | and ( 30 | FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to home for hospice care (procedure)" 31 | or FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to healthcare facility for hospice care (procedure)" 32 | ) 33 | and DischargeHospice.period ends during day of MeasurementPeriod 34 | ) 35 | or exists ( 36 | [ProcedureRequest: "Hospice care ambulatory"] HospiceOrder 37 | where HospiceOrder.intent = 'order' 38 | and HospiceOrder.authoredOn in day of MeasurementPeriod 39 | ) 40 | or exists ( 41 | [Procedure: "Hospice care ambulatory"] HospicePerformed 42 | where HospicePerformed.status = 'completed' 43 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps MeasurementPeriod 44 | ) 45 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir3/SupplementalDataElements_FHIR3-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR3 version '1.0.0' 2 | 3 | using FHIR version '3.0.0' 4 | 5 | include FHIRHelpers version '3.0.0' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir3/VTEICU_FHIR3-2.4.000.cql: -------------------------------------------------------------------------------- 1 | library VTEICU_FHIR3 version '2.4.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '3.0.0' 11 | 12 | include FHIRHelpers version '3.0.0' called FHIRHelpers 13 | include MATGlobalCommonFunctions_FHIR3 version '2.0.000' called Common 14 | 15 | // TODO: Determine how to reference a particular version of LOINC 16 | codesystem "LOINC:2.46": 'http://loinc.org' version 'urn:hl7:version:2.46' 17 | codesystem "SNOMEDCT:2016-03": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201603' 18 | 19 | valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23' 20 | 21 | code "Birthdate": '21112-8' from "LOINC:2.46" display 'Birth date' 22 | code "Dead": '419099009' from "SNOMEDCT:2016-03" display 'Dead' 23 | 24 | parameter "Measurement Period" Interval 25 | 26 | context Patient 27 | 28 | define function "ToDate"(Value DateTime): 29 | DateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezone from Value) 30 | 31 | define function "CalendarDayOfOrDayAfter"(StartValue DateTime): 32 | Interval[StartValue, ToDate(StartValue + 2 days)) 33 | 34 | define function "Start of First ICU"(Encounter "Encounter"): 35 | start of "First Intensive Care Unit"(Encounter).period 36 | 37 | define function "First Intensive Care Unit"(Encounter "Encounter"): 38 | First(Encounter.location L 39 | where Common.GetLocation(L.location).type in "Intensive Care Unit" 40 | and L.period during Encounter.period 41 | sort by start of period 42 | ) 43 | 44 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir4/AdultOutpatientEncounters_FHIR4-1.1.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR4 version '1.1.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '4.0.0' 11 | 12 | include FHIRHelpers version '4.0.0' called FHIRHelpers 13 | 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 16 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 17 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 18 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 19 | 20 | parameter "Measurement Period" Interval 21 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 22 | 23 | context Patient 24 | 25 | define function "Qualifying Encounters"(MeasurementPeriod Interval): 26 | ( 27 | [Encounter: "Office Visit"] 28 | union [Encounter: "Annual Wellness Visit"] 29 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 30 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 31 | union [Encounter: "Home Healthcare Services"] 32 | ) ValidEncounter 33 | where ValidEncounter.period during day of MeasurementPeriod 34 | and ValidEncounter.status = 'finished' 35 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir4/EXM349_FHIR4-2.9.000.cql: -------------------------------------------------------------------------------- 1 | library EXM349_FHIR4 version '2.9.000' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 7 | include SupplementalDataElements_FHIR4 version '1.0.0' called SDE 8 | 9 | codesystem "LOINC": 'http://loinc.org' 10 | 11 | valueset "Conditions Due To Human Immunodeficiency Virus (HIV)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.54' 12 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 13 | valueset "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.50' 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 16 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 17 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 18 | valueset "Preventive Care Services, Initial Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1022' 19 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 20 | valueset "Preventive Care, Established Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1024' 21 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 22 | 23 | code "HIV 1 and 2 tests - Meaningful Use set": '75622-1' from "LOINC" display 'HIV 1 and 2 tests - Meaningful Use set' 24 | 25 | parameter "Measurement Period" Interval 26 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 27 | 28 | context Patient 29 | 30 | define "Qualifying Encounters": 31 | ( [Encounter: "Preventive Care Services, Initial Office Visit, 0 to 17"] 32 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 33 | union [Encounter: "Preventive Care, Established Office Visit, 0 to 17"] 34 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 35 | union [Encounter: "Office Visit"] ) ValidEncounter 36 | where ValidEncounter.status = 'finished' 37 | and ValidEncounter.period during "Measurement Period" 38 | 39 | define "Denominator": 40 | "Initial Population" 41 | 42 | define "Denominator Exclusions": 43 | exists ( [Condition: "Conditions Due To Human Immunodeficiency Virus (HIV)"] HIVConditions 44 | where FHIRHelpers.ToConcept(HIVConditions.clinicalStatus) ~ Global."active" 45 | and FHIRHelpers.ToConcept(HIVConditions.verificationStatus) ~ Global."confirmed" 46 | and Global."Normalize Onset"(HIVConditions.onset) starts before start of "Measurement Period" ) 47 | 48 | define "Numerator": 49 | exists "HIV Test Performed" 50 | 51 | define "HIV Test Performed": 52 | ( [Observation: "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)"] 53 | union [Observation: "HIV 1 and 2 tests - Meaningful Use set"]) HIVTest 54 | where Global.CalendarAgeInYearsAt(FHIRHelpers.ToDate(Patient.birthDate), start of Global."Normalize Interval"(HIVTest.effective)) between 15 and 65 55 | and HIVTest.status in {'final', 'amended', 'corrected'} 56 | and Global."Normalize Interval"(HIVTest.effective) starts before end of "Measurement Period" 57 | 58 | define "Initial Population": 59 | Global.CalendarAgeInYearsAt(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period") between 15 and 65 60 | and exists "Qualifying Encounters" 61 | 62 | define "SDE Ethnicity": 63 | SDE."SDE Ethnicity" 64 | define "SDE Payer": 65 | SDE."SDE Payer" 66 | define "SDE Race": 67 | SDE."SDE Race" 68 | define "SDE Sex": 69 | SDE."SDE Sex" 70 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir4/Hospice_FHIR4-1.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR4 version '1.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '4.0.0' 11 | 12 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 13 | include FHIRHelpers version '4.0.0' called FHIRHelpers 14 | 15 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 16 | 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 19 | 20 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 21 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 22 | 23 | context Patient 24 | 25 | define function "Has Hospice"(MeasurementPeriod Interval): 26 | exists ( 27 | [Encounter: "Encounter Inpatient"] DischargeHospice 28 | where DischargeHospice.status = 'finished' 29 | and ( 30 | FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to home for hospice care (procedure)" 31 | or FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to healthcare facility for hospice care (procedure)" 32 | ) 33 | and DischargeHospice.period ends during day of MeasurementPeriod 34 | ) 35 | or exists ( 36 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 37 | where HospiceOrder.intent = 'order' 38 | and FHIRHelpers.ToDateTime(HospiceOrder.authoredOn) in day of MeasurementPeriod 39 | ) 40 | or exists ( 41 | [Procedure: "Hospice care ambulatory"] HospicePerformed 42 | where HospicePerformed.status = 'completed' 43 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps MeasurementPeriod 44 | ) 45 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir4/SupplementalDataElements_FHIR4-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR4 version '1.0.0' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir4/TJCOverall_FHIR4-4.0.000.cql: -------------------------------------------------------------------------------- 1 | library TJCOverall_FHIR4 version '4.0.000' 2 | 3 | using FHIR version '4.0.0' 4 | // NOTE: BTR 2019-07-30: Updated version dependencies 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 7 | include SupplementalDataElements_FHIR4 version '1.0.0' called SDE 8 | 9 | codesystem "SNOMEDCT": 'http://snomed.info/sct/731000124108' 10 | codesystem "LOINC": 'http://loinc.org' 11 | 12 | valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45' 13 | valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87' 14 | valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207' 15 | valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209' 16 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212' 19 | valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247' 20 | valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308' 21 | valueset "Non-Elective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424' 22 | valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309' 23 | valueset "Ticagrelor Therapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39' 24 | valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143' 25 | 26 | code "Birth date": '21112-8' from "LOINC" display 'Birth date' 27 | 28 | parameter "Measurement Period" Interval 29 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 30 | 31 | context Patient 32 | 33 | //Changed "ProcedureRequest" to "ServiceRequest" 34 | define "Intervention Comfort Measures": 35 | (["ServiceRequest": "Comfort Measures"] P 36 | where P.intent = 'order') 37 | union 38 | (["Procedure": "Comfort Measures"] InterventionPerformed 39 | where InterventionPerformed.status = 'completed') 40 | 41 | define "All Stroke Encounter": 42 | "Non Elective Inpatient Encounter" NonElectiveEncounter 43 | where Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke" 44 | or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke" 45 | 46 | define "Ischemic Stroke Encounter": 47 | "Encounter with Principal Diagnosis and Age" EncounterWithAge 48 | where Global.PrincipalDiagnosis(EncounterWithAge).code in "Ischemic Stroke" 49 | 50 | define "Non Elective Inpatient Encounter": 51 | ["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter 52 | where Global."LengthInDays"(NonElectiveEncounter.period) <= 120 53 | and NonElectiveEncounter.period ends during "Measurement Period" 54 | 55 | define "Ischemic Stroke Encounters with Discharge Disposition": 56 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 57 | where IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility" 58 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Left Against Medical Advice" 59 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Patient Expired" 60 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Home for Hospice Care" 61 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care" 62 | 63 | define "Comfort Measures during Hospitalization": 64 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 65 | with "Intervention Comfort Measures" ComfortMeasure 66 | such that FHIRHelpers.ToDateTime(Coalesce(ComfortMeasure.performed as dateTime,ComfortMeasure.authoredOn)) during Global."HospitalizationWithObservation"(IschemicStrokeEncounter) 67 | 68 | define "Encounter with Principal Diagnosis and Age": 69 | "All Stroke Encounter" AllStrokeEncounter 70 | with ["Patient"] BirthDate 71 | such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18 72 | 73 | define function "CalendarDayOfOrDayAfter"(StartValue DateTime ): 74 | Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days)) 75 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir4/VTEICU_FHIR4-3.1.000.cql: -------------------------------------------------------------------------------- 1 | library VTEICU_FHIR4 version '3.1.000' 2 | //For 2020 Reporting year Using FHIR R4 3 | // NOTE: BTR 2019-07-30: Renamed for consistency 4 | 5 | using FHIR version '4.0.0' 6 | 7 | include FHIRHelpers version '4.0.0' called FHIRHelpers 8 | // NOTE: BTR 2019-07-30: Updated dependencies 9 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 10 | 11 | valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23' 12 | 13 | parameter "Measurement Period" Interval 14 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 15 | 16 | context Patient 17 | 18 | define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter FHIR.Encounter ): 19 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days)) 20 | 21 | define function "StartOfFirstICU"(Encounter FHIR.Encounter ): 22 | start of "FirstICULocationPeriod"(Encounter) 23 | 24 | define function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter FHIR.Encounter ): 25 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(StartOfFirstICU(Encounter)+ 2 days)) 26 | 27 | define function "FirstICULocationPeriod"(Encounter FHIR.Encounter ): 28 | "FirstInpatientIntensiveCareUnit"(Encounter).period 29 | 30 | define function "FirstInpatientIntensiveCareUnit"(Encounter FHIR.Encounter ): 31 | First((Encounter.location)HospitalLocation 32 | where Global.GetLocation(HospitalLocation.location).type in "Intensive Care Unit" 33 | and HospitalLocation.period during Encounter.period 34 | sort by start of period 35 | ) 36 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir401/AdultOutpatientEncounters-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@@ 15 | */ 16 | 17 | using FHIR version '4.0.1' 18 | 19 | include FHIRHelpers version '4.0.1' called FHIRHelpers 20 | 21 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 22 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 23 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 24 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 25 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 26 | 27 | parameter "Measurement Period" Interval 28 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 29 | 30 | context Patient 31 | 32 | define "Qualifying Encounters": 33 | ( 34 | [Encounter: "Office Visit"] 35 | union [Encounter: "Annual Wellness Visit"] 36 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 37 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 38 | union [Encounter: "Home Healthcare Services"] 39 | ) ValidEncounter 40 | where ValidEncounter.period during "Measurement Period" 41 | and ValidEncounter.status = 'finished' 42 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir401/EXM127-9.2.000.cql: -------------------------------------------------------------------------------- 1 | library EXM127_FHIR4 version '9.2.000' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | include Hospice version '2.0.000' called Hospice 7 | include MATGlobalCommonFunctions version '5.0.000' called Global 8 | include SupplementalDataElements version '2.0.0' called SDE 9 | 10 | 11 | 12 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 13 | valueset "Care Services in Long-Term Residential Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014' 14 | valueset "Discharge Services - Nursing Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.11.1065' 15 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 16 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 17 | valueset "Nursing Facility Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012' 18 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 19 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 20 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 21 | valueset "Pneumococcal Vaccine": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1027' 22 | valueset "Pneumococcal Vaccine Administered": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1034' 23 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 24 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 25 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 26 | 27 | 28 | 29 | parameter "Measurement Period" Interval 30 | 31 | context Patient 32 | 33 | define "SDE Ethnicity": 34 | SDE."SDE Ethnicity" 35 | 36 | define "SDE Payer": 37 | SDE."SDE Payer" 38 | 39 | define "SDE Race": 40 | SDE."SDE Race" 41 | 42 | define "SDE Sex": 43 | SDE."SDE Sex" 44 | 45 | define "Initial Population": 46 | Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period")>= 65 47 | and exists "Qualifying Encounters" 48 | 49 | define "Qualifying Encounters": 50 | ([Encounter: "Office Visit"] 51 | union [Encounter: "Annual Wellness Visit"] 52 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 53 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 54 | union [Encounter: "Home Healthcare Services"] 55 | union [Encounter: "Discharge Services - Nursing Facility"] 56 | union [Encounter: "Nursing Facility Visit"] 57 | union [Encounter: "Care Services in Long-Term Residential Facility"]) ValidEncounter 58 | where ValidEncounter.period during "Measurement Period" 59 | and ValidEncounter.status = 'finished' 60 | 61 | define "Denominator": 62 | "Initial Population" 63 | 64 | define "Denominator Exclusions": 65 | Hospice."Has Hospice" 66 | 67 | define "Numerator": 68 | exists ( [Immunization: "Pneumococcal Vaccine"] PneumococcalVaccine 69 | where PneumococcalVaccine.status = 'completed' 70 | and PneumococcalVaccine.occurrence as dateTime on or before end of "Measurement Period" 71 | ) 72 | or exists ( [Procedure: "Pneumococcal Vaccine Administered"] PneumococcalVaccineGiven 73 | where PneumococcalVaccineGiven.status = 'completed' 74 | and PneumococcalVaccineGiven.performed as Period on or before end of "Measurement Period" 75 | ) 76 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir401/EXM74-10.2.000.cql: -------------------------------------------------------------------------------- 1 | library EXM74 version '10.2.000' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | include MATGlobalCommonFunctions version '5.0.000' called Global 7 | include Hospice version '2.0.000' called Hospice 8 | include SupplementalDataElements version '2.0.0' called SDE 9 | 10 | codesystem "LOINC": 'http://loinc.org' 11 | 12 | valueset "Clinical Oral Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.125.12.1003' 13 | valueset "Fluoride Varnish Application for Children": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.125.12.1002' 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "Preventive Care - Established Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1024' 16 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 17 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 18 | valueset "Preventive Care- Initial Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1022' 19 | 20 | code "Birth date": '21112-8' from "LOINC" display 'Birth date' 21 | 22 | parameter "Measurement Period" Interval 23 | 24 | context Patient 25 | 26 | define "SDE Ethnicity": 27 | SDE."SDE Ethnicity" 28 | 29 | define "SDE Payer": 30 | SDE."SDE Payer" 31 | 32 | define "SDE Race": 33 | SDE."SDE Race" 34 | 35 | define "SDE Sex": 36 | SDE."SDE Sex" 37 | 38 | define "Denominator": 39 | "Initial Population" 40 | 41 | define "Qualifying Encounters": 42 | ( ["Encounter": "Office Visit"] 43 | union ["Encounter": "Preventive Care - Established Office Visit, 0 to 17"] 44 | union ["Encounter": "Preventive Care- Initial Office Visit, 0 to 17"] 45 | union ["Encounter": "Preventive Care Services - Established Office Visit, 18 and Up"] 46 | union ["Encounter": "Preventive Care Services-Initial Office Visit, 18 and Up"] 47 | union ["Encounter": "Clinical Oral Evaluation"] ) ValidEncounter 48 | where Global."Normalize Interval"(ValidEncounter.period) during "Measurement Period" 49 | and ValidEncounter.status = 'finished' 50 | 51 | define "Denominator Exclusions": 52 | Hospice."Has Hospice" 53 | 54 | define "Stratification 2": 55 | exists ["Patient"] BirthDate 56 | where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) in Interval[5, 11] 57 | 58 | define "Stratification 3": 59 | exists ["Patient"] BirthDate 60 | where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) in Interval[12, 20 ) 61 | 62 | define "Stratification 1": 63 | exists ( ["Patient"] BirthDate 64 | where Global."CalendarAgeInMonthsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) >= 6 65 | and Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) <= 4 66 | ) 67 | 68 | define "Initial Population": 69 | exists ( ["Patient"] BirthDate 70 | where Global."CalendarAgeInMonthsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) >= 6 71 | and Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) < 20 72 | ) 73 | and exists ( "Qualifying Encounters" ) 74 | 75 | define "Numerator": 76 | exists ["Procedure": "Fluoride Varnish Application for Children"] FluorideApplication 77 | where FluorideApplication.performed during "Measurement Period" 78 | and FluorideApplication.status = 'completed' 79 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir401/Hospice-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@@ 15 | */ 16 | 17 | using FHIR version '4.0.1' 18 | 19 | include MATGlobalCommonFunctions version '5.0.000' called Global 20 | include FHIRHelpers version '4.0.1' called FHIRHelpers 21 | 22 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 23 | 24 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 25 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 26 | 27 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 28 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 29 | 30 | parameter "Measurement Period" Interval 31 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 32 | 33 | context Patient 34 | 35 | define "Has Hospice": 36 | exists ( 37 | [Encounter: "Encounter Inpatient"] DischargeHospice 38 | where DischargeHospice.status = 'finished' 39 | and ( 40 | DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)" 41 | or DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)" 42 | ) 43 | and DischargeHospice.period ends during "Measurement Period" 44 | ) 45 | or exists ( 46 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 47 | where HospiceOrder.intent = 'order' 48 | and HospiceOrder.authoredOn in "Measurement Period" 49 | ) 50 | or exists ( 51 | [Procedure: "Hospice care ambulatory"] HospicePerformed 52 | where HospicePerformed.status = 'completed' 53 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps "Measurement Period" 54 | ) 55 | -------------------------------------------------------------------------------- /pages/cql/complete/fhir401/SupplementalDataElements-2.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements version '2.0.0' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir2/SupplementalDataElements_FHIR2-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR2 version '1.0.0' 2 | 3 | using FHIR version '1.0.2' 4 | 5 | include FHIRHelpers version '1.0.2' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://fhir.org/guides/argonaut/StructureDefinition/argo-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.valueCodeableConcept 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://fhir.org/guides/argonaut/StructureDefinition/argo-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.valueCodeableConcept 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/AdultOutpatientEncounters_FHIR3-1.1.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR3 version '1.1.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '3.0.0' 11 | 12 | include FHIRHelpers version '3.0.0' called FHIRHelpers 13 | 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 16 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 17 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 18 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 19 | 20 | context Patient 21 | 22 | define function "Qualifying Encounters"(MeasurementPeriod Interval): 23 | ( 24 | [Encounter: "Office Visit"] 25 | union [Encounter: "Annual Wellness Visit"] 26 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 27 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 28 | union [Encounter: "Home Healthcare Services"] 29 | ) ValidEncounter 30 | where ValidEncounter.period during day of MeasurementPeriod 31 | and ValidEncounter.status = 'finished' 32 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/DayMonthTimings-0.9.000.cql: -------------------------------------------------------------------------------- 1 | library DayMonthTimings version '0.9.000' 2 | 3 | using QDM version '5.3' 4 | 5 | codesystem "LOINC": 'urn:oid:2.16.840.1.113883.6.1' 6 | codesystem "SNOMEDCT": 'urn:oid:2.16.840.1.113883.6.96' 7 | 8 | code "Birthdate": '21112-8' from "LOINC" display 'Birthdate' 9 | code "Dead": '419099009' from "SNOMEDCT" display 'Dead' 10 | 11 | parameter "Measurement Period" Interval 12 | 13 | context Patient 14 | 15 | define "Months": 16 | /*Identifies the number of months in a calendar year and is used with the Timing.DaysInMonth function to determine the number of days an opioid is prescribed*/ 17 | { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 } 18 | 19 | define "Months Containing 28 Days": 20 | /*Used with the Timing.DaysInMonth function to determine the months in the year containing 28 days for determining number of days the opioid is prescribed*/ 21 | { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 } 22 | 23 | define "Months Containing 29 Days": 24 | /*Used with the Timing.DaysInMonth function to determine the months in the year containing 29 days for determining the number of days an opioid is prescribed*/ 25 | { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } 26 | 27 | define "Months Containing 30 Days": 28 | /*Used with the Timing.DaysInMonth function to determine the months in the year containing 30 days for determining the number of days an opioid is prescribed*/ 29 | { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 } 30 | 31 | define "Months Containing 31 Days": 32 | /*Used with the Timing.DaysInMonth function to determine the months in the year containing 31 days for determining the number of days an opioid is prescribed */ 33 | { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 } 34 | 35 | define function "IsLeapYear"(yr Integer): 36 | /*Determines if year is a leap year*/ 37 | ( yr mod 4 = 0 38 | and yr mod 100 != 0 39 | ) 40 | or yr mod 400 = 0 41 | 42 | define function "DaysInYear"(yr Integer): 43 | /*Uses the DaysInMonth function to calculate year and months*/ 44 | flatten ( Months Mo 45 | return "DaysInMonth"(yr, Mo) 46 | ) 47 | 48 | define function "DaysInPeriod"(period Interval): 49 | /*Calculates the number of days of an opioid prescription and if the opioid prescription is within the measurement period*/ 50 | case 51 | when start of period is null 52 | or 53 | end of period is null then null 54 | when start of period same year as 55 | end of period then case 56 | when month from start of period = month from 57 | end of period then ( "DaysInMonth"(month from start of period, year from start of period)) DaysMonth 58 | where DaysMonth same day or after start of period 59 | and DaysMonth same day or before 60 | end of period 61 | else ( "DaysInYear"(year from start of period)) DaysYear 62 | where DaysYear same day or after start of period 63 | and DaysYear same day or before 64 | end of period 65 | end 66 | when difference in years between start of period and 67 | end of period = 1 then ( ( "DaysInYear"(year from start of period)) DaysYear 68 | where DaysYear same day or after start of period 69 | and DaysYear same day or before 70 | end of period 71 | ) 72 | union ( ( "DaysInYear"(year from 73 | end of period 74 | )) DaysYear 75 | where DaysYear same day or after start of period 76 | and DaysYear same day or before 77 | end of period 78 | ) 79 | else null 80 | end 81 | 82 | define function "DaysInMonth"(yr Integer, mo Integer): 83 | /*Calculates the number of days of an opioid prescription relevant period*/ 84 | ( case 85 | when mo in { 1, 3, 5, 7, 8, 10, 12 } then "Months Containing 31 Days" 86 | when mo = 2 then if "IsLeapYear"(yr)then "Months Containing 29 Days" 87 | else "Months Containing 28 Days" 88 | else "Months Containing 30 Days" 89 | end ) D 90 | return DateTime(yr, mo, D) 91 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/EXM111_FHIR3-8.0.000.cql: -------------------------------------------------------------------------------- 1 | library EXM111_FHIR3 version '8.0.000' 2 | 3 | /* 4 | Based on CMS111v8 - Median Admit Decision Time to ED Departure Time for Admitted Patients 5 | */ 6 | 7 | using FHIR version '3.0.0' 8 | 9 | include MATGlobalCommonFunctions_FHIR3 version '4.0.000' called Global 10 | include FHIRHelpers version '3.0.0' called FHIRHelpers 11 | include SupplementalDataElements_FHIR3 version '1.0.0' called SDE 12 | 13 | codesystem "SNOMEDCT": 'http://snomed.info/sct' 14 | codesystem "LOINC": 'http://loinc.org' 15 | codesystem "RequestIntent": 'http://hl7.org/fhir/request-intent' /*do we need something like this for ReferralRequest or Communication? please explain when we should add such and how do we locate?*/ 16 | codesystem "Diagnosis Role": 'http://hl7.org/fhir/diagnosis-role' 17 | 18 | valueset "Decision to Admit to Hospital Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.295' 19 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' 20 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 21 | valueset "Hospital Settings": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126' 22 | valueset "Psychiatric/Mental Health Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299' 23 | 24 | parameter "Measurement Period" Interval 25 | 26 | context Patient 27 | 28 | define "SDE Ethnicity": 29 | SDE."Ethnicity" 30 | 31 | define "SDE Payer": 32 | SDE."Payer" 33 | 34 | define "SDE Race": 35 | SDE."Race" 36 | 37 | define "SDE Sex": 38 | SDE."ONC Administrative Sex" 39 | 40 | define "Initial Population": 41 | Global."Inpatient Encounter" EncounterInpatient 42 | with "ED Visit with Admit Order" EDAdmitOrder 43 | such that EDAdmitOrder.period ends 1 hour or less before or on start of EncounterInpatient.period 44 | 45 | define "ED Visit": /*unalbe to get the Global.EDVisit logic to work here*/ 46 | ["Encounter": type in "Emergency Department Visit"] EDVisit 47 | where EDVisit.status = 'finished' 48 | 49 | define "ED Visit with Admit Order": /*7 issues revolvie around this statement. Currently Admit Order is an Encounter Order which maps to ReferralRequest, which does not seem appropriate, please advise*/ 50 | "ED Visit" EDVisit 51 | with [ReferralRequest: "Decision to Admit to Hospital Inpatient"] AdmitOrder 52 | such that AdmitOrder.authoredOn during EDVisit.period 53 | and AdmitOrder.intent in { 'plan', 'order' } 54 | 55 | define "Measure Population": 56 | "Initial Population" 57 | 58 | define "Measure Population Exclusions": 59 | Global."Inpatient Encounter" EncounterInpatient 60 | with "ED Visit" EDVisit 61 | such that EDVisit.period ends 1 hour or less before or on start of EncounterInpatient.period 62 | and EDVisit.status='finished' 63 | and EDVisit.hospitalization.admitSource in "Hospital Settings" 64 | 65 | define "Stratification 1": 66 | Global."Inpatient Encounter" EncounterInpatient 67 | where Global."PrincipalDiagnosis" (EncounterInpatient) is null 68 | or not (Global."PrincipalDiagnosis"(EncounterInpatient).code in "Psychiatric/Mental Health Diagnosis" ) 69 | 70 | define "Stratification 2": 71 | Global."Inpatient Encounter" EncounterInpatient 72 | where Global."PrincipalDiagnosis"(EncounterInpatient).code in "Psychiatric/Mental Health Diagnosis" 73 | 74 | define function "AdmitDecision"(Encounter "Encounter"): 75 | Last( 76 | [ReferralRequest: "Decision to Admit to Hospital Inpatient"] AdmitOrder 77 | where AdmitOrder.authoredOn during "RelatedEDVisit"(Encounter).period 78 | and AdmitOrder.intent in { 'plan', 'order' } 79 | ) 80 | 81 | define function "DepartureTime"(Encounter "Encounter"): 82 | Last(Encounter.location FacilityLocation 83 | return 84 | end of FacilityLocation.period 85 | sort ascending) 86 | 87 | define function "MeasureObservation"(Encounter "Encounter"): 88 | duration in minutes of Interval["AdmitDecision"(Encounter).authoredOn, "DepartureTime"("RelatedEDVisit"(Encounter))] 89 | 90 | define function "RelatedEDVisit"(Encounter "Encounter"): 91 | Last ("ED Visit with Admit Order" EDVisit 92 | where EDVisit.period ends 1 hour or less before or on start of Encounter.period 93 | sort by start of period) 94 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/EXM146_FHIR3-4.0.0.cql: -------------------------------------------------------------------------------- 1 | library EXM146_FHIR version '4.0.0' 2 | //This version was pulled from the May 2019 QM IG as a starting point for conversion 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '3.0.0' 11 | 12 | include FHIRHelpers version '3.0.0' called FHIRHelpers 13 | include Common_FHIR version '2.0.0' called Common 14 | 15 | valueset "Acute Pharyngitis": 'https://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.102.12.1011' 16 | valueset "Acute Tonsillitis": 'https://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.102.12.1012' 17 | valueset "Ambulatory/ED Visit": 'https://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1061' 18 | valueset "Antibiotic Medications": 'https://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1001' 19 | valueset "Group A Streptococcus Test": 'https://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1012' 20 | 21 | parameter "Measurement Period" Interval 22 | 23 | context Patient 24 | 25 | // Region: Initial Population 26 | 27 | define "In Demographic": 28 | AgeInYearsAt(start of "Measurement Period")>= 2 29 | and AgeInYearsAt(start of "Measurement Period")< 18 30 | 31 | define "Antibiotics": 32 | [MedicationRequest: medication in "Antibiotic Medications"] Prescription 33 | where Prescription.status = 'active' 34 | and Prescription.intent = 'order' 35 | 36 | define "Pharyngitis": 37 | ( [Condition: code in "Acute Pharyngitis"] 38 | union [Condition: code in "Acute Tonsillitis"] ) Pharyngitis 39 | where Pharyngitis.clinicalStatus = 'active' 40 | and Pharyngitis.verificationStatus = 'confirmed' 41 | 42 | define "Measurement Period Encounters": 43 | [Encounter: "Ambulatory/ED Visit"] Encounter 44 | where Encounter.period during "Measurement Period" 45 | and Encounter.status = 'finished' 46 | and "In Demographic" 47 | 48 | define "Pharyngitis Encounters With Antibiotics": 49 | "Measurement Period Encounters" Encounters 50 | with "Pharyngitis" Pharyngitis 51 | such that Common."Includes Or Starts During"(Pharyngitis, Encounters) 52 | with "Antibiotics" Antibiotics 53 | such that Antibiotics.authoredOn 3 days or less after FHIRHelpers.ToInterval(Encounters.period) 54 | 55 | define "Initial Population": 56 | "Pharyngitis Encounters With Antibiotics" 57 | 58 | // EndRegion: Initial Population 59 | 60 | // Region: Denominator 61 | 62 | // None 63 | 64 | // EndRegion: Denominator 65 | 66 | // Region: Denominator Exclusions 67 | 68 | define "Pharyngitis With Prior Antibiotics": 69 | "Pharyngitis" Pharyngitis 70 | with "Antibiotics" Antibiotics 71 | such that Antibiotics.authoredOn 30 days or less before Pharyngitis.onset 72 | 73 | define "Excluded Encounters": 74 | "Pharyngitis Encounters With Antibiotics" Encounters 75 | with "Pharyngitis With Prior Antibiotics" Pharyngitis 76 | such that Common."Includes Or Starts During"(Pharyngitis, Encounters) 77 | 78 | define "Denominator Exclusions": 79 | "Excluded Encounters" 80 | 81 | // EndRegion: Denominator Exclusions 82 | 83 | // Region: Denominator Exceptions 84 | 85 | // None 86 | 87 | // EndRegion: Denominator Exceptions 88 | 89 | // Region: Numerator 90 | 91 | define "Strep Test Encounters": 92 | "Pharyngitis Encounters With Antibiotics" Encounters 93 | with [Observation: code in "Group A Streptococcus Test"] Tests 94 | such that Tests.value is not null 95 | and Tests.effective starts during Interval[start of FHIRHelpers.ToInterval(Encounters.period)- 3 days, 96 | end of FHIRHelpers.ToInterval(Encounters.period)+ 3 days] 97 | 98 | define "Numerator": 99 | "Strep Test Encounters" 100 | 101 | // EndRegion: Numerator 102 | 103 | // Region: Numerator Exclusion 104 | 105 | // None 106 | 107 | // EndRegion: Numerator Exclusion 108 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/EXM161_FHIR3-8.0.0.cql: -------------------------------------------------------------------------------- 1 | library EXM161_FHIR3 version '8.0.0' 2 | /*CMS61 Adult MDD*/ 3 | //All measures need a library// 4 | //Each measure needs to have a library specified// 5 | 6 | using FHIR version '3.0.0' 7 | //include library MATGlobalCommonFunctions_FHIR version '4.0.000' called Global// 8 | //includes do not use the term 'library'// 9 | include MATGlobalCommonFunctions_FHIR3 version '4.0.000' called Global 10 | include FHIRHelpers version '3.0.0' called FHIRHelpers 11 | 12 | codesystem SNOMEDCT: 'https://snomed.info/sct' 13 | 14 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010' 15 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 16 | valueset "Major Depressive Disorder-Active": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1491' 17 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 18 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 19 | valueset "Outpatient Consultation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008' 20 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 21 | valueset "Psych Visit - Diagnostic Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492' 22 | valueset "Psych Visit - Psychotherapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496' 23 | valueset "Psychoanalysis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1141' 24 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 25 | valueset "Telehealth Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1031' 26 | 27 | code "Suicide risk assessment (procedure)": '225337009' from "SNOMEDCT" display 'Suicide risk assessment (procedure)' 28 | 29 | parameter "Measurement Period" Interval default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 30 | 31 | context Patient 32 | 33 | define "Denominator": 34 | "Initial Population" 35 | 36 | define "Initial Population": 37 | "New or Recurrent Major Depressive Disorder Encounter" NewOrRecurrentMDDEncounter 38 | where Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period")>= 17 39 | 40 | define "Major Depressive Disorder Encounter": 41 | ( ["Encounter": "Psych Visit - Diagnostic Evaluation"] 42 | union ["Encounter": "Emergency Department Visit"] 43 | union ["Encounter": "Office Visit"] 44 | union ["Encounter": "Outpatient Consultation"] 45 | union ["Encounter": "Psych Visit - Psychotherapy"] 46 | union ["Encounter": "Psychoanalysis"] 47 | union ["Encounter": "Telehealth Services"] ) ValidEncounter 48 | where ValidEncounter.status = 'finished' 49 | and Global.EncounterDiagnosis(ValidEncounter).code in "Major Depressive Disorder-Active" 50 | 51 | define "New or Recurrent Major Depressive Disorder Encounter": 52 | "Major Depressive Disorder Encounter" NewOrRecurrentMDDEncounter 53 | without "Major Depressive Disorder Encounter" PriorMDDEpisodeEncounter 54 | such that PriorMDDEpisodeEncounter !~ NewOrRecurrentMDDEncounter 55 | and PriorMDDEpisodeEncounter.period ends 104 days or less before day of start of NewOrRecurrentMDDEncounter.period 56 | where NewOrRecurrentMDDEncounter.period during "Measurement Period" 57 | 58 | define "Numerator": 59 | "New or Recurrent Major Depressive Disorder Encounter" NewOrRecurrentMDDEncounter 60 | with ["Procedure": "Suicide risk assessment (procedure)"] SuicideRiskAssessment 61 | such that SuicideRiskAssessment.performed during NewOrRecurrentMDDEncounter.period 62 | and SuicideRiskAssessment.status = 'completed' 63 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/EXM177_FHIR3-8.1.000.cql: -------------------------------------------------------------------------------- 1 | library EXM177_FHIR3 version '8.1.000' 2 | 3 | using FHIR version '3.0.0' 4 | 5 | //This measures is based on CMS177 V8.1.000 Child and Adolesent Major Depressive Disorder:Suicide Risk Assessment 6 | include MATGlobalCommonFunctions_FHIR3 version '4.0.000' called Global 7 | include FHIRHelpers version '3.0.0' called FHIRHelpers 8 | include SupplementalDataElements_FHIR3 version '1.0.0' called SDE 9 | 10 | codesystem "LOINC": 'http://loinc.org' 11 | codesystem "SNOMEDCT": 'https://snomed.info/sct' 12 | 13 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 14 | valueset "Group Psychotherapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1187' 15 | valueset "Major Depressive Disorder-Active": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1491' 16 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 17 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 18 | valueset "Outpatient Consultation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008' 19 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 20 | valueset "Psych Visit - Diagnostic Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492' 21 | valueset "Psych Visit - Family Psychotherapy": 'http://cts.nlm.nih.gov/fhir/ValueSet2.16.840.1.113883.3.526.3.1018' 22 | valueset "Psych Visit - Psychotherapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496' 23 | valueset "Psychoanalysis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1141' 24 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 25 | valueset "Telehealth Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1031' 26 | 27 | code "Birth date": '21112-8' from "LOINC" display 'Birth date' 28 | code "Suicide risk assessment (procedure)": '225337009' from "SNOMEDCT" display 'Suicide risk assessment (procedure)' 29 | 30 | parameter "Measurement Period" Interval 31 | 32 | context Patient 33 | 34 | define "SDE Ethnicity": 35 | SDE."SDE Ethnicity" 36 | 37 | define "SDE Payer": 38 | SDE."SDE Payer" 39 | 40 | define "SDE Race": 41 | SDE."SDE Race" 42 | 43 | define "SDE Sex": 44 | SDE."SDE Sex" 45 | define "Denominator": 46 | "Initial Population" 47 | 48 | define "Major Depressive Disorder Encounter": 49 | ( ["Encounter": "Office Visit"] 50 | union ["Encounter": "Outpatient Consultation"] 51 | union ["Encounter": "Psych Visit - Diagnostic Evaluation"] 52 | union ["Encounter": "Psych Visit - Family Psychotherapy"] 53 | union ["Encounter": "Psych Visit - Psychotherapy"] 54 | union ["Encounter": "Psychoanalysis"] 55 | union ["Encounter": "Group Psychotherapy"] 56 | union ["Encounter": "Telehealth Services"] ) ValidEncounter 57 | where ValidEncounter.status = 'finished' 58 | and Global.EncounterDiagnosis(ValidEncounter).code in "Major Depressive Disorder-Active" 59 | 60 | define "Numerator": 61 | "Major Depressive Disorder Encounter" MDDEncounter 62 | with ["Procedure": "Suicide risk assessment (procedure)"] SuicideRiskAssessment 63 | such that Global."Normalize Interval"(SuicideRiskAssessment.performed) during MDDEncounter.period 64 | and SuicideRiskAssessment.status = 'completed' 65 | 66 | 67 | define "Initial Population": 68 | "Major Depressive Disorder Encounter" MDDEncounter 69 | where Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period")>= 6 70 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period")< 17 71 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/EXM349_FHIR3-2.9.000.cql: -------------------------------------------------------------------------------- 1 | library EXM349_FHIR3 version '2.9.000' 2 | 3 | /* 4 | Based on CMS349v2 - HIV Screening 5 | */ 6 | 7 | using FHIR version '3.0.0' 8 | 9 | include MATGlobalCommonFunctions_FHIR3 version '2.0.000' called Global 10 | include FHIRHelpers version '3.0.0' called FHIRHelpers 11 | include SupplementalDataElements_FHIR3 version '1.0.0' called SDE 12 | 13 | codesystem "LOINC": 'http://loinc.org' 14 | 15 | valueset "Conditions Due To Human Immunodeficiency Virus (HIV)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.54' 16 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 17 | valueset "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.50' 18 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 19 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 20 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 21 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 22 | valueset "Preventive Care Services, Initial Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1022' 23 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 24 | valueset "Preventive Care, Established Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1024' 25 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 26 | 27 | code "HIV 1 and 2 tests - Meaningful Use set": '75622-1' from "LOINC" display 'HIV 1 and 2 tests - Meaningful Use set' 28 | 29 | parameter "Measurement Period" Interval default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 30 | 31 | context Patient 32 | 33 | define "SDE Ethnicity": 34 | SDE."SDE Ethnicity" 35 | 36 | define "SDE Payer": 37 | SDE."SDE Payer" 38 | 39 | define "SDE Race": 40 | SDE."SDE Race" 41 | 42 | define "SDE Sex": 43 | SDE."SDE Sex" 44 | 45 | define "Qualifying Encounters": 46 | ( [Encounter: "Preventive Care Services, Initial Office Visit, 0 to 17"] 47 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 48 | union [Encounter: "Preventive Care, Established Office Visit, 0 to 17"] 49 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 50 | union [Encounter: "Office Visit"] ) ValidEncounter 51 | where ValidEncounter.status = 'finished' 52 | and ValidEncounter.period during "Measurement Period" 53 | 54 | define "Denominator": 55 | "Initial Population" 56 | 57 | define "Denominator Exclusion": 58 | exists ( [Condition: code in "Conditions Due To Human Immunodeficiency Virus (HIV)"] HIVConditions 59 | where HIVConditions.clinicalStatus = 'active' 60 | and HIVConditions.verificationStatus = 'confirmed' 61 | and (HIVConditions.onset as dateTime) before start of "Measurement Period" 62 | ) 63 | 64 | define "Numerator": 65 | exists ( "HIV Test Performed" ) 66 | 67 | define "HIV Test Performed": 68 | ( [Observation: "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)"] 69 | union [Observation: "HIV 1 and 2 tests - Meaningful Use set"] ) HIVTest 70 | where ( 71 | ( Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), HIVTest.effective as dateTime)>= 15 72 | or Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of HIVTest.effective)>= 15) 73 | and ( Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), HIVTest.effective as dateTime)< 66 ) 74 | or Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of HIVTest.effective)< 66) 75 | 76 | and HIVTest.status in {'final', 'amended', 'corrected', 'preliminary'} 77 | and ( 78 | HIVTest.effective starts before end of "Measurement Period" 79 | or HIVTest.effective as dateTime before end of "Measurement Period" 80 | ) 81 | 82 | define "Initial Population": 83 | Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period")>= 15 84 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period")< 66 85 | and exists "Qualifying Encounters" 86 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/Hospice_FHIR3-1.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR3 version '1.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '3.0.0' 11 | 12 | include MATGlobalCommonFunctions_FHIR3 version '2.0.000' called Global 13 | include FHIRHelpers version '3.0.0' called FHIRHelpers 14 | 15 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 16 | 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 19 | 20 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 21 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 22 | 23 | context Patient 24 | 25 | define function "Has Hospice"(MeasurementPeriod Interval): 26 | exists ( 27 | [Encounter: "Encounter Inpatient"] DischargeHospice 28 | where DischargeHospice.status = 'final' 29 | and ( 30 | FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to home for hospice care (procedure)" 31 | or FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to healthcare facility for hospice care (procedure)" 32 | ) 33 | and DischargeHospice.period ends during day of MeasurementPeriod 34 | ) 35 | or exists ( 36 | [ProcedureRequest: "Hospice care ambulatory"] HospiceOrder 37 | where HospiceOrder.intent = 'order' 38 | and HospiceOrder.authoredOn in day of MeasurementPeriod 39 | ) 40 | or exists ( 41 | [Procedure: "Hospice care ambulatory"] HospicePerformed 42 | where HospicePerformed.status = 'completed' 43 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps MeasurementPeriod 44 | ) 45 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/SupplementalDataElements_FHIR3-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR3 version '1.0.0' 2 | 3 | using FHIR version '3.0.0' 4 | 5 | include FHIRHelpers version '3.0.0' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/TJCOverall_FHIR3-3.6.000.cql: -------------------------------------------------------------------------------- 1 | library TJCOverall_FHIR3 version '3.6.000' 2 | 3 | using FHIR version '3.0.0' 4 | include FHIRHelpers version '3.0.0' called FHIRHelpers 5 | //TODO: MATGlobalCommonFunctions_FHIR version '2.0.000' need to be updated to 4.0 6 | include MATGlobalCommonFunctions_FHIR3 version '4.0.000' called Global 7 | include SupplementalDataElements_FHIR3 version '1.0.0' called SDE 8 | 9 | codesystem "SNOMEDCT": 'http://snomed.info/sct/731000124108' 10 | codesystem "LOINC": 'http://loinc.org' 11 | 12 | valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45' 13 | valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87' 14 | valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207' 15 | valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209' 16 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212' 19 | valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247' 20 | valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308' 21 | valueset "Non-Elective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424' 22 | valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309' 23 | valueset "Ticagrelor Therapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39' 24 | valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143' 25 | 26 | code "Birth date": '21112-8' from "LOINC" display 'Birth date' 27 | 28 | parameter "Measurement Period" Interval 29 | 30 | context Patient 31 | 32 | define "Intervention Comfort Measures": 33 | (["ProcedureRequest": "Comfort Measures"] P 34 | where P.intent = 'order') 35 | union 36 | (["Procedure": "Comfort Measures"] InterventionPerformed 37 | where InterventionPerformed.status = 'completed') 38 | 39 | define "All Stroke Encounter": 40 | "Non Elective Inpatient Encounter" NonElectiveEncounter 41 | where Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke" 42 | or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke" 43 | 44 | define "Ischemic Stroke Encounter": 45 | "Encounter with Principal Diagnosis and Age" EncounterWithAge 46 | where Global.PrincipalDiagnosis(EncounterWithAge).code in "Ischemic Stroke" 47 | 48 | define "Non Elective Inpatient Encounter": 49 | ["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter 50 | where Global."LengthInDays"(NonElectiveEncounter.period)<= 120 51 | and NonElectiveEncounter.period ends during "Measurement Period" 52 | 53 | define "Ischemic Stroke Encounters with Discharge Disposition": 54 | ( ( "Ischemic Stroke Encounter" IschemicStrokeEncounter 55 | where IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility" 56 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Left Against Medical Advice" 57 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Patient Expired" 58 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Home for Hospice Care" 59 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care" 60 | ) 61 | ) 62 | 63 | define "Comfort Measures during Hospitalization": 64 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 65 | with "Intervention Comfort Measures" ComfortMeasure 66 | such that Coalesce(start of FHIRHelpers.ToInterval(ComfortMeasure.performed), ComfortMeasure.authoredOn)during Global."HospitalizationWithObservation"(IschemicStrokeEncounter) 67 | 68 | define "Encounter with Principal Diagnosis and Age": 69 | "All Stroke Encounter" AllStrokeEncounter 70 | with ["Patient"] BirthDate 71 | such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18 72 | 73 | define function "CalendarDayOfOrDayAfter"(StartValue DateTime ): 74 | Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days)) 75 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/TJC_Overall_QDM5-1.4.000.cql: -------------------------------------------------------------------------------- 1 | library TJC_Overall_QDM5 version '1.4.000' 2 | 3 | using QDM version '5.3' 4 | 5 | include MATGlobalCommonFunctions_QDM5 version '2.0.000' called Global 6 | 7 | codesystem "LOINC:2.46": 'urn:oid:2.16.840.1.113883.6.1' version 'urn:hl7:version:2.46' 8 | codesystem "SNOMEDCT:2016-03": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2016-03' 9 | 10 | valueset "Encounter Inpatient": 'urn:oid:2.16.840.1.113883.3.666.5.307' 11 | valueset "Non-Elective Inpatient Encounter": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.424' 12 | valueset "Ischemic Stroke": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.247' 13 | valueset "Hemorrhagic Stroke": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.212' 14 | valueset "Comfort Measures": 'urn:oid:1.3.6.1.4.1.33895.1.3.0.45' 15 | valueset "Emergency Department Visit": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.292' 16 | valueset "Left Against Medical Advice": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.308' 17 | valueset "Discharged to Health Care Facility for Hospice Care": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.207' 18 | valueset "Patient Expired": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.309' 19 | valueset "Discharge To Acute Care Facility": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.87' 20 | valueset "Discharged to Home for Hospice Care": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.209' 21 | 22 | code "Birthdate": '21112-8' from "LOINC:2.46" display 'Birth date' 23 | code "Dead": '419099009' from "SNOMEDCT:2016-03" display 'Dead' 24 | 25 | parameter "Measurement Period" Interval 26 | 27 | context Patient 28 | 29 | define "Intervention Comfort Measures": 30 | ["Intervention, Order": "Comfort Measures"] 31 | union ["Intervention, Performed": "Comfort Measures"] 32 | 33 | define "All Stroke Encounter": 34 | "Non Elective Inpatient Encounter" NonElectiveEncounter 35 | where NonElectiveEncounter.principalDiagnosis in "Hemorrhagic Stroke" 36 | or NonElectiveEncounter.principalDiagnosis in "Ischemic Stroke" 37 | 38 | define "Ischemic Stroke Encounter": 39 | "Encounter with Principal Diagnosis and Age" EncounterWithAge 40 | where EncounterWithAge.principalDiagnosis in "Ischemic Stroke" 41 | 42 | define "Ischemic Stroke Encounters with Discharge Status": 43 | ( ( "Ischemic Stroke Encounter" IschemicStrokeEncounter 44 | where IschemicStrokeEncounter.dischargeDisposition in "Discharge To Acute Care Facility" 45 | or IschemicStrokeEncounter.dischargeDisposition in "Left Against Medical Advice" 46 | or IschemicStrokeEncounter.dischargeDisposition in "Patient Expired" 47 | or IschemicStrokeEncounter.dischargeDisposition in "Discharged to Home for Hospice Care" 48 | or IschemicStrokeEncounter.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care" 49 | ) 50 | ) 51 | 52 | define "Comfort Measures during Hospitalization": 53 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 54 | with "Intervention Comfort Measures" ComfortMeasure 55 | such that Coalesce(start of ComfortMeasure.relevantPeriod, ComfortMeasure.authorDatetime)during Global."Hospitalization"(IschemicStrokeEncounter) 56 | 57 | define "Encounter with Principal Diagnosis and Age": 58 | "All Stroke Encounter" AllStrokeEncounter 59 | with ["Patient Characteristic Birthdate"] BirthDate 60 | such that Global."CalendarAgeInYearsAt"(BirthDate.birthDatetime, start of AllStrokeEncounter.relevantPeriod)>= 18 61 | 62 | define "Non Elective Inpatient Encounter": 63 | ["Encounter, Performed": "Non-Elective Inpatient Encounter"] NonElectiveEncounter 64 | where Global."LengthInDays"(NonElectiveEncounter.relevantPeriod)<= 120 65 | and NonElectiveEncounter.relevantPeriod ends during "Measurement Period" 66 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir3/VTEICU_FHIR3-3.1.000.cql: -------------------------------------------------------------------------------- 1 | //For 2020 Reporting year Using FHIR R4 2 | library VTEICU_FHIR3 version '3.1.000' 3 | 4 | using FHIR version '3.0.0' 5 | 6 | include FHIRHelpers version '3.0.0' called FHIRHelpers 7 | include MATGlobalCommonFunctions_FHIR3 version '4.0.000' called Global 8 | 9 | valueset "Intensive Care Unit": 'urn:oid:2.16.840.1.113762.1.4.1029.206' 10 | 11 | parameter "Measurement Period" Interval 12 | 13 | context Patient 14 | 15 | define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter FHIR.Encounter ): 16 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days)) 17 | 18 | define function "StartOfFirstICU"(Encounter FHIR.Encounter ): 19 | start of "FirstICULocationPeriod"(Encounter) 20 | 21 | define function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter FHIR.Encounter ): 22 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(StartOfFirstICU(Encounter)+ 2 days)) 23 | 24 | define function "FirstICULocationPeriod"(Encounter FHIR.Encounter ): 25 | "FirstInpatientIntensiveCareUnit"(Encounter).period 26 | 27 | define function "FirstInpatientIntensiveCareUnit"(Encounter FHIR.Encounter ): 28 | First((Encounter.location)HospitalLocation 29 | where Global.GetLocation(HospitalLocation.location).type in "Intensive Care Unit" 30 | and HospitalLocation.period during Encounter.period 31 | sort by start of period 32 | ) 33 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/AdultOutpatientEncounters_FHIR4-1.1.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR4 version '1.1.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '4.0.0' 11 | 12 | include FHIRHelpers version '4.0.0' called FHIRHelpers 13 | 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 16 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 17 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 18 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 19 | 20 | parameter "Measurement Period" Interval 21 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 22 | 23 | context Patient 24 | 25 | define function "Qualifying Encounters"(MeasurementPeriod Interval): 26 | ( 27 | [Encounter: "Office Visit"] 28 | union [Encounter: "Annual Wellness Visit"] 29 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 30 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 31 | union [Encounter: "Home Healthcare Services"] 32 | ) ValidEncounter 33 | where ValidEncounter.period during day of MeasurementPeriod 34 | and ValidEncounter.status = 'finished' 35 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/EXM111_FHIR4-8.0.000.cql: -------------------------------------------------------------------------------- 1 | library EXM111_FHIR4 version '8.0.000' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000'called Global 6 | include FHIRHelpers version '4.0.0' called FHIRHelpers 7 | include SupplementalDataElements_FHIR4 version '1.0.0' called SDE 8 | 9 | codesystem "SNOMEDCT": 'http://snomed.info/sct' 10 | codesystem "LOINC": 'http://loinc.org' 11 | codesystem "RequestIntent": 'http://hl7.org/fhir/request-intent' /*do we need something like this for ReferralRequest or Communication? please explain when we should add such and how do we locate?*/ 12 | codesystem "Diagnosis Role": 'http://hl7.org/fhir/diagnosis-role' 13 | 14 | valueset "Decision to Admit to Hospital Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.295' 15 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' 16 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 17 | valueset "Hospital Settings": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126' 18 | valueset "Psychiatric/Mental Health Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299' 19 | 20 | parameter "Measurement Period" Interval 21 | 22 | context Patient 23 | 24 | define "SDE Ethnicity": 25 | SDE."Ethnicity" 26 | 27 | define "SDE Payer": 28 | SDE."Payer" 29 | 30 | define "SDE Race": 31 | SDE."Race" 32 | 33 | define "SDE Sex": 34 | SDE."ONC Administrative Sex" 35 | 36 | define "Initial Population": 37 | Global."Inpatient Encounter" EncounterInpatient 38 | with "ED Visit with Admit Order" EDAdmitOrder 39 | such that EDAdmitOrder.period ends 1 hour or less before or on start of EncounterInpatient.period 40 | 41 | define "ED Visit": /*unable to get the Global.EDVisit logic to work here*/ 42 | ["Encounter": type in "Emergency Department Visit"] EDVisit 43 | where EDVisit.status='finished' 44 | 45 | define "ED Visit with Admit Order": /*7 issues revolve around this statement. Currently Admit Order is an Encounter Order which maps to ReferralRequest, which does not seem appropriate, please advise*/ 46 | "ED Visit" EDVisit 47 | with [ServiceRequest: "Decision to Admit to Hospital Inpatient"] AdmitOrder 48 | such that FHIRHelpers.ToDateTime(AdmitOrder.authoredOn) during FHIRHelpers.ToInterval(EDVisit.period) 49 | and AdmitOrder.intent in {'plan', 'order'} 50 | 51 | 52 | define "Measure Population": 53 | "Initial Population" 54 | 55 | define "Measure Population Exclusions": 56 | Global."Inpatient Encounter" EncounterInpatient 57 | with "ED Visit" EDVisit 58 | such that EDVisit.period ends 1 hour or less before or on start of EncounterInpatient.period 59 | and EDVisit.status='finished' 60 | and EDVisit.hospitalization.admitSource in "Hospital Settings" 61 | 62 | define "Stratification 1": 63 | /*Encounters of patients without a principal diagnosis in the "Psychiatric/Mental Health Diagnosis" value set*/ 64 | Global."Inpatient Encounter" EncounterInpatient 65 | where not exists ( Global."Inpatient Encounter" EncounterInpatient 66 | where Global."PrincipalDiagnosis"(EncounterInpatient).code in "Psychiatric/Mental Health Diagnosis") EncounterPrincipalDx 67 | or ( Global."Inpatient Encounter" EncounterInpatient 68 | where Global."PrincipalDiagnosis"(EncounterInpatient).code in "Psychiatric/Mental Health Diagnosis") is null 69 | 70 | define "Stratification 2": 71 | /*Encounters of patients with a principal diagnosis that is in the "Psychiatric/Mental Health Diagnosis" value set*/ 72 | Global."Inpatient Encounter" EncounterInpatient 73 | where Global."PrincipalDiagnosis"(EncounterInpatient).code in "Psychiatric/Mental Health Diagnosis" 74 | 75 | define function "AdmitDecision"(Encounter "Encounter"): 76 | Last( 77 | [ServiceRequest: "Decision to Admit to Hospital Inpatient"] AdmitOrder 78 | where FHIRHelpers.ToDateTime(AdmitOrder.authoredOn) during FHIRHelpers.ToInterval("RelatedEDVisit"(Encounter).period) 79 | and AdmitOrder.intent in {'plan', 'order'} 80 | ) 81 | 82 | define function "DepartureTime"(Encounter "Encounter"): 83 | Last(Encounter.location FacilityLocation 84 | return 85 | end of FacilityLocation.period 86 | sort ascending) 87 | 88 | define function "MeasureObservation"(Encounter "Encounter"): 89 | duration in minutes of Interval[FHIRHelpers.ToDateTime("AdmitDecision"(Encounter).authoredOn), ("DepartureTime"("RelatedEDVisit"(Encounter)))] 90 | 91 | 92 | 93 | define function "RelatedEDVisit"(Encounter "Encounter"): 94 | Last ("ED Visit with Admit Order" EDVisit 95 | where (EDVisit.period) ends 1 hour or less before or on start of (Encounter.period) 96 | sort by start of period) 97 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/EXM349_FHIR4-2.9.000.cql: -------------------------------------------------------------------------------- 1 | library HIVScreening version '2.9.000' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 7 | include SupplementalDataElements_FHIR4 version '1.0.0' called SDE 8 | 9 | codesystem "LOINC": 'http://loinc.org' 10 | 11 | valueset "Conditions Due To Human Immunodeficiency Virus (HIV)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.54' 12 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 13 | valueset "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.50' 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 16 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 17 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 18 | valueset "Preventive Care Services, Initial Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1022' 19 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 20 | valueset "Preventive Care, Established Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1024' 21 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 22 | 23 | code "HIV 1 and 2 tests - Meaningful Use set": '75622-1' from "LOINC" display 'HIV 1 and 2 tests - Meaningful Use set' 24 | 25 | parameter "Measurement Period" Interval 26 | 27 | context Patient 28 | 29 | define "SDE Ethnicity": 30 | SDE."SDE Ethnicity" 31 | 32 | define "SDE Payer": 33 | SDE."SDE Payer" 34 | 35 | define "SDE Race": 36 | SDE."SDE Race" 37 | 38 | define "SDE Sex": 39 | SDE."SDE Sex" 40 | 41 | define "Qualifying Encounters": 42 | ( [Encounter: "Preventive Care Services, Initial Office Visit, 0 to 17"] 43 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 44 | union [Encounter: "Preventive Care, Established Office Visit, 0 to 17"] 45 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 46 | union [Encounter: "Office Visit"] ) ValidEncounter 47 | where ValidEncounter.status = 'finished' 48 | and ValidEncounter.period during "Measurement Period" 49 | 50 | define "Denominator": 51 | "Initial Population" 52 | 53 | define "Denominator Exclusions": 54 | exists ( [Condition: code in "Conditions Due To Human Immunodeficiency Virus (HIV)"] HIVConditions 55 | where FHIRHelpers.ToConcept(HIVConditions.clinicalStatus) ~ Global."active" 56 | and FHIRHelpers.ToConcept(HIVConditions.verificationStatus) ~ Global."confirmed" 57 | and Global."Normalize Onset"(HIVConditions.onset) starts before start of "Measurement Period" ) 58 | 59 | define "Numerator": 60 | exists "HIV Test Performed" 61 | 62 | define "HIV Test Performed": 63 | ( [Observation: "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)"] 64 | union [Observation: "HIV 1 and 2 tests - Meaningful Use set"] ) HIVTest 65 | where Global.CalendarAgeInYearsAt(FHIRHelpers.ToDate(Patient.birthDate), start of Global."Normalize Interval"(HIVTest.effective)) between 15 and 65 66 | and HIVTest.status in {'final', 'amended', 'corrected'} 67 | and Global."Normalize Interval"(HIVTest.effective) starts before end of "Measurement Period" 68 | 69 | define "Initial Population": 70 | Global.CalendarAgeInYearsAt(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period") between 15 and 65 71 | and exists "Qualifying Encounters" 72 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/Hospice_FHIR4-1.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR4 version '1.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '4.0.0' 11 | 12 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 13 | include FHIRHelpers version '4.0.0' called FHIRHelpers 14 | 15 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 16 | 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 19 | 20 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 21 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 22 | 23 | context Patient 24 | 25 | define function "Has Hospice"(MeasurementPeriod Interval): 26 | exists ( 27 | [Encounter: "Encounter Inpatient"] DischargeHospice 28 | where DischargeHospice.status = 'finished' 29 | and ( 30 | FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to home for hospice care (procedure)" 31 | or FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to healthcare facility for hospice care (procedure)" 32 | ) 33 | and DischargeHospice.period ends during day of MeasurementPeriod 34 | ) 35 | or exists ( 36 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 37 | where HospiceOrder.intent = 'order' 38 | and FHIRHelpers.ToDateTime(HospiceOrder.authoredOn) in day of MeasurementPeriod 39 | ) 40 | or exists ( 41 | [Procedure: "Hospice care ambulatory"] HospicePerformed 42 | where HospicePerformed.status = 'completed' 43 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps MeasurementPeriod 44 | ) 45 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/SupplementalDataElements_FHIR4-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR4 version '1.0.0' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/TJCOverall_FHIR4-4.0.000.cql: -------------------------------------------------------------------------------- 1 | library TJCOverall_FHIR4 version '4.0.000' 2 | 3 | using FHIR version '4.0.0' 4 | // NOTE: BTR 2019-07-30: Updated version dependencies 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 7 | include SupplementalDataElements_FHIR4 version '1.0.0' called SDE 8 | 9 | codesystem "SNOMEDCT": 'http://snomed.info/sct/731000124108' 10 | codesystem "LOINC": 'http://loinc.org' 11 | 12 | valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45' 13 | valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87' 14 | valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207' 15 | valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209' 16 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212' 19 | valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247' 20 | valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308' 21 | valueset "Non-Elective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424' 22 | valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309' 23 | valueset "Ticagrelor Therapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39' 24 | valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143' 25 | 26 | code "Birth date": '21112-8' from "LOINC" display 'Birth date' 27 | 28 | parameter "Measurement Period" Interval 29 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 30 | 31 | context Patient 32 | 33 | //Changed "ProcedureRequest" to "ServiceRequest" 34 | define "Intervention Comfort Measures": 35 | (["ServiceRequest": "Comfort Measures"] P 36 | where P.intent = 'order') 37 | union 38 | (["Procedure": "Comfort Measures"] InterventionPerformed 39 | where InterventionPerformed.status = 'completed') 40 | 41 | define "All Stroke Encounter": 42 | "Non Elective Inpatient Encounter" NonElectiveEncounter 43 | where Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke" 44 | or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke" 45 | 46 | define "Ischemic Stroke Encounter": 47 | "Encounter with Principal Diagnosis and Age" EncounterWithAge 48 | where Global.PrincipalDiagnosis(EncounterWithAge).code in "Ischemic Stroke" 49 | 50 | define "Non Elective Inpatient Encounter": 51 | ["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter 52 | where Global."LengthInDays"(NonElectiveEncounter.period) <= 120 53 | and NonElectiveEncounter.period ends during "Measurement Period" 54 | 55 | define "Ischemic Stroke Encounters with Discharge Disposition": 56 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 57 | where IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility" 58 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Left Against Medical Advice" 59 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Patient Expired" 60 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Home for Hospice Care" 61 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care" 62 | 63 | define "Comfort Measures during Hospitalization": 64 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 65 | with "Intervention Comfort Measures" ComfortMeasure 66 | such that FHIRHelpers.ToDateTime(Coalesce(ComfortMeasure.performed as dateTime,ComfortMeasure.authoredOn)) during Global."HospitalizationWithObservation"(IschemicStrokeEncounter) 67 | 68 | define "Encounter with Principal Diagnosis and Age": 69 | "All Stroke Encounter" AllStrokeEncounter 70 | with ["Patient"] BirthDate 71 | such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18 72 | 73 | define function "CalendarDayOfOrDayAfter"(StartValue DateTime ): 74 | Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days)) 75 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir4/VTEICU_FHIR4-3.1.000.cql: -------------------------------------------------------------------------------- 1 | library VTEICU_FHIR4 version '3.1.000' 2 | //For 2020 Reporting year Using FHIR R4 3 | // NOTE: BTR 2019-07-30: Renamed for consistency 4 | 5 | using FHIR version '4.0.0' 6 | 7 | include FHIRHelpers version '4.0.0' called FHIRHelpers 8 | // NOTE: BTR 2019-07-30: Updated dependencies 9 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 10 | 11 | valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23' 12 | 13 | parameter "Measurement Period" Interval 14 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 15 | 16 | context Patient 17 | 18 | define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter FHIR.Encounter ): 19 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days)) 20 | 21 | define function "StartOfFirstICU"(Encounter FHIR.Encounter ): 22 | start of "FirstICULocationPeriod"(Encounter) 23 | 24 | define function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter FHIR.Encounter ): 25 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(StartOfFirstICU(Encounter)+ 2 days)) 26 | 27 | define function "FirstICULocationPeriod"(Encounter FHIR.Encounter ): 28 | "FirstInpatientIntensiveCareUnit"(Encounter).period 29 | 30 | define function "FirstInpatientIntensiveCareUnit"(Encounter FHIR.Encounter ): 31 | First((Encounter.location)HospitalLocation 32 | where Global.GetLocation(HospitalLocation.location).type in "Intensive Care Unit" 33 | and HospitalLocation.period during Encounter.period 34 | sort by start of period 35 | ) 36 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/AdultOutpatientEncounters_FHIR4-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@@ 15 | */ 16 | 17 | using FHIR version '4.0.1' 18 | 19 | include FHIRHelpers version '4.0.1' called FHIRHelpers 20 | 21 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 22 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 23 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 24 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 25 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 26 | 27 | parameter "Measurement Period" Interval 28 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 29 | 30 | context Patient 31 | 32 | define "Qualifying Encounters": 33 | ( 34 | [Encounter: "Office Visit"] 35 | union [Encounter: "Annual Wellness Visit"] 36 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 37 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 38 | union [Encounter: "Home Healthcare Services"] 39 | ) ValidEncounter 40 | where ValidEncounter.period during "Measurement Period" 41 | and ValidEncounter.status = 'finished' 42 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/EXM122_FHIR4-9.3.000.cql: -------------------------------------------------------------------------------- 1 | library DiabetesHemoglobinA1cHbA1cPoorControl9 version '9.1.000' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '5.0.000' called Global 7 | include Hospice_FHIR4 version '2.0.000' called Hospice 8 | include AdvancedIllnessandFrailtyExclusion_FHIR4 version '5.0.000' called FrailtyLTI 9 | include SupplementalDataElements_FHIR4 version '2.0.0' called SDE 10 | include AdultOutpatientEncounters_FHIR4 version '2.0.000' called AdultOutpatientEncounters 11 | 12 | valueset "Diabetes": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001' 13 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 14 | valueset "HbA1c Laboratory Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1013' 15 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 16 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 17 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 18 | 19 | 20 | parameter "Measurement Period" Interval 21 | 22 | context Patient 23 | 24 | define "SDE Ethnicity": 25 | SDE."SDE Ethnicity" 26 | 27 | define "SDE Payer": 28 | SDE."SDE Payer" 29 | 30 | define "SDE Race": 31 | SDE."SDE Race" 32 | 33 | define "SDE Sex": 34 | SDE."SDE Sex" 35 | 36 | define "Initial Population": 37 | exists ( ["Patient"] BirthDate 38 | where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) in Interval[18, 75) 39 | ) 40 | and exists AdultOutpatientEncounters."Qualifying Encounters" 41 | and exists ( ["Condition": "Diabetes"] Diabetes 42 | where Diabetes.clinicalStatus ~ Global."active" 43 | and Global."Prevalence Period"(Diabetes) overlaps "Measurement Period" 44 | ) 45 | 46 | define "Denominator": 47 | "Initial Population" 48 | 49 | define "Denominator Exclusions": 50 | Hospice."Has Hospice" 51 | or FrailtyLTI."Advanced Illness and Frailty Exclusion Not Including Over Age 80" 52 | or ( exists ["Patient"] BirthDate 53 | where ( Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period" ) >= 65 ) 54 | and FrailtyLTI."Long Term Care Periods Longer Than 90 Consecutive Days" 55 | ) 56 | 57 | define "Numerator": 58 | "Has Most Recent HbA1c Without Result" 59 | or "Has Most Recent Elevated HbA1c" 60 | or "Has No Record Of HbA1c" 61 | 62 | define "Has Most Recent Elevated HbA1c": 63 | "Most Recent HbA1c".value > 9 '%' 64 | 65 | define "Has Most Recent HbA1c Without Result": 66 | "Most Recent HbA1c" is not null 67 | and "Most Recent HbA1c".value is null 68 | 69 | define "Most Recent HbA1c": 70 | Last(["Observation": "HbA1c Laboratory Test"] RecentHbA1c 71 | where RecentHbA1c.status in {'final', 'amended', 'preliminary', 'corrected'} 72 | and end of Global."Normalize Interval"(RecentHbA1c.effective) during "Measurement Period" 73 | sort by end of Global."Normalize Interval"(effective) 74 | ) 75 | 76 | define "Has No Record Of HbA1c": 77 | not exists ( ["Observation": "HbA1c Laboratory Test"] NoHbA1c 78 | where ( NoHbA1c.status in {'final', 'amended', 'preliminary', 'corrected'} 79 | and end of Global."Normalize Interval"(NoHbA1c.effective) during "Measurement Period" 80 | )) 81 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/EXM139_FHIR4-9.1.000.cql: -------------------------------------------------------------------------------- 1 | library Falls_Logic version '9.1.000' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | include Hospice_FHIR4 version '2.0.000' called Hospice 7 | include MATGlobalCommonFunctions_FHIR4 version '5.0.000' called Global 8 | include SupplementalDataElements_FHIR4 version '2.0.0' called SDE 9 | 10 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'urn:hl7:version:2016-09' 11 | codesystem "SNOMEDCT": 'http://snomed.info/sct/731000124108' 12 | codesystem "LOINC": 'http://loinc.org' 13 | 14 | valueset "Annual Wellness Visit":'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 15 | valueset "Audiology Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1066' 16 | valueset "Care Services in Long-Term Residential Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014' 17 | valueset "Discharge Services - Nursing Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1013' 18 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 19 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 20 | valueset "Falls Screening": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1028' 21 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 22 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 23 | valueset "Nursing Facility Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012' 24 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 25 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 26 | valueset "Ophthalmological Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1285' 27 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 28 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 29 | valueset "Preventive Care Services-Individual Counseling": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1026' 30 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 31 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 32 | 33 | code "Birthdate": '21112-8' from "LOINC" display 'Birth date' 34 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 35 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 36 | 37 | parameter "Measurement Period" Interval 38 | 39 | context Patient 40 | 41 | define "SDE Ethnicity": 42 | SDE."SDE Ethnicity" 43 | 44 | define "SDE Payer": 45 | SDE."SDE Payer" 46 | 47 | define "SDE Race": 48 | SDE."SDE Race" 49 | 50 | define "SDE Sex": 51 | SDE."SDE Sex" 52 | 53 | define "Initial Population": 54 | ["Patient"] BirthDate 55 | where Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period")>= 65 56 | and exists "Qualifying Encounter" 57 | 58 | define "Qualifying Encounter": 59 | ([Encounter: "Office Visit"] 60 | union [Encounter: "Annual Wellness Visit"] 61 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 62 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 63 | union [Encounter: "Home Healthcare Services"] 64 | union [Encounter: "Ophthalmological Services"] 65 | union [Encounter: "Preventive Care Services-Individual Counseling"] 66 | union [Encounter: "Discharge Services - Nursing Facility"] 67 | union [Encounter: "Nursing Facility Visit"] 68 | union [Encounter: "Care Services in Long-Term Residential Facility"] 69 | union [Encounter: "Audiology Visit"]) ValidEncounter 70 | where ValidEncounter.period during "Measurement Period" 71 | and ValidEncounter.status = 'finished' 72 | 73 | define "Denominator": 74 | "Initial Population" 75 | 76 | define "Denominator Exclusions": 77 | Hospice."Has Hospice" 78 | 79 | define "Numerator": 80 | [Observation: "Falls Screening"] FallsScreening 81 | where FallsScreening.status in {'final', 'amended', 'corrected', 'preliminary'} 82 | and Global."Normalize Interval"(FallsScreening.effective) during "Measurement Period" 83 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/EXM75_FHIR4-9.2.000.cql: -------------------------------------------------------------------------------- 1 | library ChildrenWhoHaveDentalDecayorCavities version '9.2.000' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '5.0.000' called Global 7 | include Hospice_FHIR4 version '2.0.000' called Hospice 8 | include SupplementalDataElements_FHIR4 version '2.0.0' called SDE 9 | 10 | codesystem "LOINC": 'http://loinc.org' 11 | 12 | valueset "Clinical Oral Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.125.12.1003' 13 | valueset "Dental Caries": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.125.12.1004' 14 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 15 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 16 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 17 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 18 | 19 | parameter "Measurement Period" Interval 20 | 21 | context Patient 22 | 23 | define "SDE Ethnicity": 24 | SDE."SDE Ethnicity" 25 | 26 | define "SDE Payer": 27 | SDE."SDE Payer" 28 | 29 | define "SDE Race": 30 | SDE."SDE Race" 31 | 32 | define "SDE Sex": 33 | SDE."SDE Sex" 34 | 35 | define "Initial Population": 36 | exists ["Patient"] BirthDate 37 | where Global."CalendarAgeInMonthsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period") >= 6 38 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of "Measurement Period") <20 39 | and exists "Qualifying Encounters" 40 | 41 | define "Qualifying Encounters": 42 | ["Encounter": "Clinical Oral Evaluation"] ValidEncounter 43 | where Global."Normalize Interval"(ValidEncounter.period) during "Measurement Period" 44 | and ValidEncounter.status in { 'arrived', 'triaged', 'in-progress', 'on-leave', 'finished' } 45 | 46 | define "Denominator": 47 | "Initial Population" 48 | 49 | define "Denominator Exclusions": 50 | Hospice."Has Hospice" 51 | 52 | define "Numerator": 53 | exists ( ["Condition": "Dental Caries"] DentalCaries 54 | where (DentalCaries.clinicalStatus ~ ToConcept(Global."active") 55 | or DentalCaries.clinicalStatus ~ ToConcept(Global."recurrence") 56 | or DentalCaries.clinicalStatus ~ ToConcept(Global."relapse") 57 | and Global."Prevalence Period"(DentalCaries) overlaps "Measurement Period") 58 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/Hospice_FHIR4-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@@ 15 | */ 16 | 17 | using FHIR version '4.0.1' 18 | 19 | include MATGlobalCommonFunctions_FHIR4 version '5.0.000' called Global 20 | include FHIRHelpers version '4.0.1' called FHIRHelpers 21 | 22 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 23 | 24 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 25 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 26 | 27 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 28 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 29 | 30 | parameter "Measurement Period" Interval 31 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 32 | 33 | context Patient 34 | 35 | define "Has Hospice": 36 | exists ( 37 | [Encounter: "Encounter Inpatient"] DischargeHospice 38 | where DischargeHospice.status = 'finished' 39 | and ( 40 | DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)" 41 | or DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)" 42 | ) 43 | and DischargeHospice.period ends during "Measurement Period" 44 | ) 45 | or exists ( 46 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 47 | where HospiceOrder.intent = 'order' 48 | and HospiceOrder.authoredOn in "Measurement Period" 49 | ) 50 | or exists ( 51 | [Procedure: "Hospice care ambulatory"] HospicePerformed 52 | where HospicePerformed.status = 'completed' 53 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps "Measurement Period" 54 | ) 55 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/PalliativeCareHEDIS_FHIR4-0.1.000.cql: -------------------------------------------------------------------------------- 1 | library PalliativeCareHEDIS version '0.1.000' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | include NCQA_Common version '5.1.000' called Common 7 | 8 | valueset "Palliative Care Assessment": 'https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.2225' 9 | valueset "Palliative Care Encounter": 'https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1450' 10 | valueset "Palliative Care Intervention": 'https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.2224' 11 | 12 | parameter "Measurement Period" Interval 13 | 14 | context Patient 15 | 16 | define "Palliative Care in the Measurement Period": 17 | exists ( ["Observation": "Palliative Care Assessment"] PalliativeAssessment 18 | where PalliativeAssessment.status in {'final','amended','corrected'} 19 | and Common."Normalize Interval"(PalliativeAssessment.effective) during "Measurement Period" 20 | ) 21 | or exists ( ["Encounter": "Palliative Care Encounter"] PalliativeEncounter 22 | where PalliativeEncounter.status = 'finished' 23 | and PalliativeEncounter.period overlaps "Measurement Period" 24 | ) 25 | or exists ( ["Procedure": "Palliative Care Intervention"] PalliativeIntervention 26 | where PalliativeIntervention.status in {'completed','in-progress'} 27 | and Common."Normalize Interval"(PalliativeIntervention.performed) overlaps "Measurement Period" 28 | ) 29 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/SupplementalDataElements_FHIR4-2.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR4 version '2.0.0' 2 | 3 | /* 4 | @update: @@BTR 2020-03-31 -> 5 | Incremented version to 2.0.0 6 | Updated FHIR version to 4.0.1 7 | @@@ 8 | */ 9 | 10 | using FHIR version '4.0.1' 11 | 12 | include FHIRHelpers version '4.0.1' called FHIRHelpers 13 | 14 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 15 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 16 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 17 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 18 | 19 | context Patient 20 | 21 | define "SDE Ethnicity": 22 | (flatten ( 23 | Patient.extension Extension 24 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 25 | return Extension.extension 26 | )) E 27 | where E.url = 'ombCategory' 28 | or E.url = 'detailed' 29 | return E.value as Coding 30 | 31 | define "SDE Payer": 32 | [Coverage: type in "Payer"] Payer 33 | return { 34 | code: Payer.type, 35 | period: Payer.period 36 | } 37 | 38 | define "SDE Race": 39 | (flatten ( 40 | Patient.extension Extension 41 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 42 | return Extension.extension 43 | )) E 44 | where E.url = 'ombCategory' 45 | or E.url = 'detailed' 46 | return E.value as Coding 47 | 48 | define "SDE Sex": 49 | case 50 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 51 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 52 | else null 53 | end 54 | -------------------------------------------------------------------------------- /pages/cql/in-progress/fhir401/TerminologyGuidance.cql: -------------------------------------------------------------------------------- 1 | library TerminologyGuidance 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' 6 | 7 | codesystem "Observation Category Codes": 'http://terminology.hl7.org/CodeSystem/observation-category' 8 | 9 | code "Observation Category: Social History": 'social-history' from "Observation Category Codes" display 'Social History' 10 | code "Observation Category: Vital Signs": 'vital-signs' from "Observation Category Codes" display 'Vital Signs' 11 | 12 | context Patient 13 | 14 | /* 15 | # Terminology Resources 16 | * CodeSystem - A set of codes, has a URL and version 17 | * ValueSet - A subset of a code system (or code systems) 18 | * Can ONLY bind to ValueSets, not CodeSystems 19 | 20 | Code systems defined in FHIR 21 | Code systems define externally 22 | ValueSets defined in FHIR 23 | ValueSets defined in VSAC 24 | 25 | # Terminology Type Elements in FHIR 26 | * code - Required binding to FHIR-defined value set 27 | * CodeableConcept - Required, Preferred, or Extensible binding to FHIR-defined value set 28 | 29 | If the element is defined with a Required binding to a FHIR-defined value set, the element will 30 | be of type "code" meaning that it only has the actual code, and can be referenced directly. 31 | Note that the code system is explicitly defined by the FHIR resource/profile, and that is 32 | the _only_ reason that it is "safe" to reference the code value as a string. 33 | 34 | If the element is defined with any other binding (Preferred, Extensible, Example), then 35 | the element will be of type "CodeableConcept" (almost always, especially for eCQM usage), 36 | meaning that comparisons _must_ be to specific concepts defined in code systems, or 37 | membership tests against value sets. 38 | 39 | # Examples 40 | 41 | ## code element 42 | [Observation.status](http://hl7.org/fhir/R4/observation-definitions.html#Observation.status) 43 | */ 44 | 45 | define ObservationStatusComparison: 46 | [Observation] O 47 | where O.status in { 'final', 'amended' } 48 | 49 | /* 50 | ## CodeableConcept element bound to FHIR-defined value set 51 | [Observation.category](http://hl7.org/fhir/R4/observation-definitions.html#Observation.category) 52 | 53 | Navigate to the Value Set definition 54 | [observation-category](http://hl7.org/fhir/R4/valueset-observation-category.html) 55 | 56 | Navigate to the Code System definition 57 | [ObservationCategoryCodes](http://hl7.org/fhir/R4/codesystem-observation-category.html) 58 | Copy the "Defining URL" into a code system declaration: 59 | 60 | codesystem "": '<Defining URL>' 61 | codesystem "Observation Category Codes": 'http://terminology.hl7.org/CodeSystem/observation-category' 62 | 63 | Best practice is _not_ to include the version unless necessary. If version is required, 64 | specify it using the version component of the code system declaration: 65 | 66 | codesystem "<Title>:<Version>": '<Defining URL>' version '<Version>' 67 | codesystem "Observation Category Codes:4.0.1": 'http://terminology.hl7.org/CodeSystem/observation-category' version '4.0.1' 68 | 69 | Declare the codes in the code system for use as direct-reference codes within CQL: 70 | 71 | code "[<Code System Title>: ]<Display>": '<Code>' from "<Code System Title>" display '<Display>' 72 | 73 | code "Observation Category: Social History": 'social-history' from "Observation Category Codes" display 'Social History' 74 | code "Observation Category: Vital Signs": 'vital-signs' from "Observation Category Codes" display 'Vital Signs' 75 | ... 76 | */ 77 | 78 | define ObservationCategoryComparison: 79 | [Observation] O 80 | where O.category contains ToConcept("Observation Category: Vital Signs") 81 | -------------------------------------------------------------------------------- /pages/cql/in-progress/qicore/AdultOutpatientEncounters_QICore4-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_QICore4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@ 15 | */ 16 | 17 | using QICore version '4.0.0' 18 | 19 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 20 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 21 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 22 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 23 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 24 | 25 | parameter "Measurement Period" Interval<DateTime> 26 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 27 | 28 | context Patient 29 | 30 | define "Qualifying Encounters": 31 | ( 32 | [Encounter: "Office Visit"] 33 | union [Encounter: "Annual Wellness Visit"] 34 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 35 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 36 | union [Encounter: "Home Healthcare Services"] 37 | ) ValidEncounter 38 | where ValidEncounter.period during "Measurement Period" 39 | and ValidEncounter.status = 'finished' 40 | -------------------------------------------------------------------------------- /pages/cql/in-progress/qicore/Hospice_QICore4-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_QICore4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@ 15 | */ 16 | 17 | using QICore version '4.0.0' 18 | 19 | include MATGlobalCommonFunctions_QICore4 version '5.0.000' called Global 20 | 21 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 22 | 23 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 24 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 25 | 26 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 27 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 28 | 29 | parameter "Measurement Period" Interval<DateTime> 30 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 31 | 32 | context Patient 33 | 34 | define "Has Hospice": 35 | exists ( 36 | [Encounter: "Encounter Inpatient"] DischargeHospice 37 | where DischargeHospice.status = 'finished' 38 | and ( 39 | DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)" 40 | or DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)" 41 | ) 42 | and DischargeHospice.period ends during "Measurement Period" 43 | ) 44 | or exists ( 45 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 46 | where HospiceOrder.intent = 'order' 47 | and HospiceOrder.authoredOn in "Measurement Period" 48 | ) 49 | or exists ( 50 | [Procedure: "Hospice care ambulatory"] HospicePerformed 51 | where HospicePerformed.status = 'completed' 52 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps "Measurement Period" 53 | ) 54 | -------------------------------------------------------------------------------- /pages/cql/in-progress/qicore/SupplementalDataElements_QICore4-2.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_QICore4 version '2.0.0' 2 | 3 | /* 4 | @update: @@BTR 2020-03-31 -> 5 | Incremented version to 2.0.0 6 | Updated FHIR version to 4.0.1 7 | @@ 8 | */ 9 | 10 | using QICore version '4.0.0' 11 | 12 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 13 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 14 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 15 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 16 | 17 | context Patient 18 | 19 | define "SDE Ethnicity": 20 | Patient.ethnicity.detailed 21 | 22 | define "SDE Payer": 23 | [Coverage: type in "Payer"] Payer 24 | return { 25 | code: Payer.type, 26 | period: Payer.period 27 | } 28 | 29 | define "SDE Race": 30 | Patient.race.detailed 31 | 32 | define "SDE Sex": 33 | case 34 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 35 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 36 | else null 37 | end 38 | -------------------------------------------------------------------------------- /pages/cql/in-progress/qicore/VTEICU_QICore4-4.0.000.cql: -------------------------------------------------------------------------------- 1 | library VTEICU_QICore4 version '4.0.000' 2 | 3 | /* 4 | @update: @@BTR 2020-03-31 -> 5 | Incremented version to 5.0.000 6 | Updated FHIR version to 4.0.1 7 | @@ 8 | */ 9 | 10 | using QICore version '4.0.0' 11 | 12 | // NOTE: BTR 2019-07-30: Updated dependencies 13 | include MATGlobalCommonFunctions_QICore4 version '5.0.000' called Global 14 | 15 | valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23' 16 | 17 | parameter "Measurement Period" Interval<DateTime> 18 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 19 | 20 | context Patient 21 | 22 | define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter Encounter ): 23 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days)) 24 | 25 | define function "StartOfFirstICU"(Encounter Encounter ): 26 | start of "FirstICULocationPeriod"(Encounter) 27 | 28 | define function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter Encounter ): 29 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(StartOfFirstICU(Encounter)+ 2 days)) 30 | 31 | define function "FirstICULocationPeriod"(Encounter Encounter ): 32 | "FirstInpatientIntensiveCareUnit"(Encounter).period 33 | 34 | define function "FirstInpatientIntensiveCareUnit"(Encounter Encounter ): 35 | First((Encounter.location)HospitalLocation 36 | where Global.GetLocation(HospitalLocation.location).type in "Intensive Care Unit" 37 | and HospitalLocation.period during Encounter.period 38 | sort by start of period 39 | ) 40 | -------------------------------------------------------------------------------- /pages/cql/release/fhir4/AdultOutpatientEncounters_FHIR4-1.1.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR4 version '1.1.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '4.0.0' 11 | 12 | include FHIRHelpers version '4.0.0' called FHIRHelpers 13 | 14 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 15 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 16 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 17 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 18 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 19 | 20 | parameter "Measurement Period" Interval<DateTime> 21 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 22 | 23 | context Patient 24 | 25 | define function "Qualifying Encounters"(MeasurementPeriod Interval<DateTime>): 26 | ( 27 | [Encounter: "Office Visit"] 28 | union [Encounter: "Annual Wellness Visit"] 29 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 30 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 31 | union [Encounter: "Home Healthcare Services"] 32 | ) ValidEncounter 33 | where ValidEncounter.period during day of MeasurementPeriod 34 | and ValidEncounter.status = 'finished' 35 | -------------------------------------------------------------------------------- /pages/cql/release/fhir4/Hospice_FHIR4-1.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR4 version '1.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | using FHIR version '4.0.0' 11 | 12 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 13 | include FHIRHelpers version '4.0.0' called FHIRHelpers 14 | 15 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 16 | 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 19 | 20 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 21 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 22 | 23 | context Patient 24 | 25 | define function "Has Hospice"(MeasurementPeriod Interval<DateTime>): 26 | exists ( 27 | [Encounter: "Encounter Inpatient"] DischargeHospice 28 | where DischargeHospice.status = 'finished' 29 | and ( 30 | FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to home for hospice care (procedure)" 31 | or FHIRHelpers.ToConcept(DischargeHospice.hospitalization.dischargeDisposition).codes[0] ~ "Discharge to healthcare facility for hospice care (procedure)" 32 | ) 33 | and DischargeHospice.period ends during day of MeasurementPeriod 34 | ) 35 | or exists ( 36 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 37 | where HospiceOrder.intent = 'order' 38 | and FHIRHelpers.ToDateTime(HospiceOrder.authoredOn) in day of MeasurementPeriod 39 | ) 40 | or exists ( 41 | [Procedure: "Hospice care ambulatory"] HospicePerformed 42 | where HospicePerformed.status = 'completed' 43 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps MeasurementPeriod 44 | ) 45 | -------------------------------------------------------------------------------- /pages/cql/release/fhir4/SupplementalDataElements_FHIR4-1.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements_FHIR4 version '1.0.0' 2 | 3 | using FHIR version '4.0.0' 4 | 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | 48 | -------------------------------------------------------------------------------- /pages/cql/release/fhir4/TJCOverall_FHIR4-4.0.000.cql: -------------------------------------------------------------------------------- 1 | library TJCOverall_FHIR4 version '4.0.000' 2 | 3 | using FHIR version '4.0.0' 4 | // NOTE: BTR 2019-07-30: Updated version dependencies 5 | include FHIRHelpers version '4.0.0' called FHIRHelpers 6 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 7 | include SupplementalDataElements_FHIR4 version '1.0.0' called SDE 8 | 9 | codesystem "SNOMEDCT": 'http://snomed.info/sct/731000124108' 10 | codesystem "LOINC": 'http://loinc.org' 11 | 12 | valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45' 13 | valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87' 14 | valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207' 15 | valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209' 16 | valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' 17 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 18 | valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212' 19 | valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247' 20 | valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308' 21 | valueset "Non-Elective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424' 22 | valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309' 23 | valueset "Ticagrelor Therapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39' 24 | valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143' 25 | 26 | code "Birth date": '21112-8' from "LOINC" display 'Birth date' 27 | 28 | parameter "Measurement Period" Interval<DateTime> 29 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 30 | 31 | context Patient 32 | 33 | //Changed "ProcedureRequest" to "ServiceRequest" 34 | define "Intervention Comfort Measures": 35 | (["ServiceRequest": "Comfort Measures"] P 36 | where P.intent = 'order') 37 | union 38 | (["Procedure": "Comfort Measures"] InterventionPerformed 39 | where InterventionPerformed.status = 'completed') 40 | 41 | define "All Stroke Encounter": 42 | "Non Elective Inpatient Encounter" NonElectiveEncounter 43 | where Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke" 44 | or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke" 45 | 46 | define "Ischemic Stroke Encounter": 47 | "Encounter with Principal Diagnosis and Age" EncounterWithAge 48 | where Global.PrincipalDiagnosis(EncounterWithAge).code in "Ischemic Stroke" 49 | 50 | define "Non Elective Inpatient Encounter": 51 | ["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter 52 | where Global."LengthInDays"(NonElectiveEncounter.period) <= 120 53 | and NonElectiveEncounter.period ends during "Measurement Period" 54 | 55 | define "Ischemic Stroke Encounters with Discharge Disposition": 56 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 57 | where IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility" 58 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Left Against Medical Advice" 59 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Patient Expired" 60 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Home for Hospice Care" 61 | or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care" 62 | 63 | define "Comfort Measures during Hospitalization": 64 | "Ischemic Stroke Encounter" IschemicStrokeEncounter 65 | with "Intervention Comfort Measures" ComfortMeasure 66 | such that FHIRHelpers.ToDateTime(Coalesce(ComfortMeasure.performed as dateTime,ComfortMeasure.authoredOn)) during Global."HospitalizationWithObservation"(IschemicStrokeEncounter) 67 | 68 | define "Encounter with Principal Diagnosis and Age": 69 | "All Stroke Encounter" AllStrokeEncounter 70 | with ["Patient"] BirthDate 71 | such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18 72 | 73 | define function "CalendarDayOfOrDayAfter"(StartValue DateTime ): 74 | Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days)) 75 | -------------------------------------------------------------------------------- /pages/cql/release/fhir4/VTEICU_FHIR4-3.1.000.cql: -------------------------------------------------------------------------------- 1 | library VTEICU_FHIR4 version '3.1.000' 2 | //For 2020 Reporting year Using FHIR R4 3 | // NOTE: BTR 2019-07-30: Renamed for consistency 4 | 5 | using FHIR version '4.0.0' 6 | 7 | include FHIRHelpers version '4.0.0' called FHIRHelpers 8 | // NOTE: BTR 2019-07-30: Updated dependencies 9 | include MATGlobalCommonFunctions_FHIR4 version '4.0.000' called Global 10 | 11 | valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23' 12 | 13 | parameter "Measurement Period" Interval<DateTime> 14 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 15 | 16 | context Patient 17 | 18 | define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter FHIR.Encounter ): 19 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days)) 20 | 21 | define function "StartOfFirstICU"(Encounter FHIR.Encounter ): 22 | start of "FirstICULocationPeriod"(Encounter) 23 | 24 | define function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter FHIR.Encounter ): 25 | Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(StartOfFirstICU(Encounter)+ 2 days)) 26 | 27 | define function "FirstICULocationPeriod"(Encounter FHIR.Encounter ): 28 | "FirstInpatientIntensiveCareUnit"(Encounter).period 29 | 30 | define function "FirstInpatientIntensiveCareUnit"(Encounter FHIR.Encounter ): 31 | First((Encounter.location)HospitalLocation 32 | where Global.GetLocation(HospitalLocation.location).type in "Intensive Care Unit" 33 | and HospitalLocation.period during Encounter.period 34 | sort by start of period 35 | ) 36 | -------------------------------------------------------------------------------- /pages/cql/release/fhir401/AdultOutpatientEncounters-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library AdultOutpatientEncounters_FHIR4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@@ 15 | */ 16 | 17 | using FHIR version '4.0.1' 18 | 19 | include FHIRHelpers version '4.0.1' called FHIRHelpers 20 | 21 | valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001' 22 | valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240' 23 | valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025' 24 | valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023' 25 | valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016' 26 | 27 | parameter "Measurement Period" Interval<DateTime> 28 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 29 | 30 | context Patient 31 | 32 | define "Qualifying Encounters": 33 | ( 34 | [Encounter: "Office Visit"] 35 | union [Encounter: "Annual Wellness Visit"] 36 | union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"] 37 | union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"] 38 | union [Encounter: "Home Healthcare Services"] 39 | ) ValidEncounter 40 | where ValidEncounter.period during "Measurement Period" 41 | and ValidEncounter.status = 'finished' 42 | -------------------------------------------------------------------------------- /pages/cql/release/fhir401/EXM124-9.0.000.cql: -------------------------------------------------------------------------------- 1 | library EXM124_FHIR401 version '9.0.000' 2 | 3 | 4 | /* 5 | Based on CMS124v7 - Cervical Cancer Screening 6 | */ 7 | 8 | /* 9 | This example is a work in progress and should not be considered a final specification 10 | or recommendation for guidance. This example will help guide and direct the process 11 | of finding conventions and usage patterns that meet the needs of the various stakeholders 12 | in the measure development community. 13 | */ 14 | 15 | using FHIR version '4.0.1' 16 | 17 | include FHIRHelpers version '4.0.1' called FHIRHelpers 18 | include Hospice version '2.0.000' called Hospice 19 | include AdultOutpatientEncounters version '2.0.000' called AdultOutpatientEncounters 20 | include MATGlobalCommonFunctions version '5.0.000' called Global 21 | include SupplementalDataElements version '2.0.0' called SDE 22 | 23 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 24 | 25 | valueset "Hysterectomy with No Residual Cervix": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1014' 26 | valueset "Pap Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1017' 27 | valueset "HPV Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1059' 28 | 29 | code "Congenital absence of cervix (disorder)": '37687000' from "SNOMEDCT:2017-09" display 'Congenital absence of cervix (disorder)' 30 | 31 | parameter "Measurement Period" Interval<DateTime> 32 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 33 | 34 | context Patient 35 | 36 | define "SDE Ethnicity": 37 | SDE."SDE Ethnicity" 38 | 39 | define "SDE Payer": 40 | SDE."SDE Payer" 41 | 42 | define "SDE Race": 43 | SDE."SDE Race" 44 | 45 | define "SDE Sex": 46 | SDE."SDE Sex" 47 | 48 | define "Initial Population": 49 | Patient.gender = 'female' 50 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of "Measurement Period") in Interval[23, 64] 51 | and exists AdultOutpatientEncounters."Qualifying Encounters" 52 | 53 | define "Denominator": 54 | "Initial Population" 55 | 56 | define "Denominator Exclusion": 57 | Hospice."Has Hospice" 58 | or exists "Absence of Cervix" 59 | 60 | define "Absence of Cervix": 61 | ([Procedure: "Hysterectomy with No Residual Cervix"] NoCervixProcedure 62 | where Global."Normalize Interval"(NoCervixProcedure.performed) ends on or before end of "Measurement Period" 63 | and NoCervixProcedure.status = 'completed' 64 | ) 65 | union [Condition : "Congenital absence of cervix (disorder)"] NoCervixBirth 66 | where Global."Normalize Interval"(NoCervixBirth.onset) starts on or before end of "Measurement Period" 67 | // and NoCervixBirth.clinicalStatus ~ ToConcept(Global."active") because this is an excluion, all statuses are acceptable 68 | 69 | define "Numerator": 70 | exists "Cervical Cytology Within 3 Years" 71 | or exists "HPV Test Within 5 Years for Women Age 30 and Older" 72 | 73 | define "Cervical Cytology Within 3 Years": 74 | [Observation: "Pap Test"] CervicalCytology 75 | where CervicalCytology.value is not null 76 | and CervicalCytology.status in { 'final', 'amended', 'corrected', 'preliminary' } 77 | and Global."Normalize Interval"(CervicalCytology.effective) ends 3 years or less on or before end of "Measurement Period" 78 | 79 | define "HPV Test Within 5 Years for Women Age 30 and Older": 80 | [Observation: "HPV Test"] HPVTest 81 | where HPVTest.value is not null 82 | and HPVTest.status in { 'final', 'amended', 'corrected', 'preliminary' } 83 | and Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(Patient.birthDate), start of Global."Normalize Interval"(HPVTest.effective))>= 30 84 | and Global."Normalize Interval"(HPVTest.effective) ends 5 years or less on or before end of "Measurement Period" 85 | -------------------------------------------------------------------------------- /pages/cql/release/fhir401/Hospice-2.0.000.cql: -------------------------------------------------------------------------------- 1 | library Hospice_FHIR4 version '2.0.000' 2 | 3 | /* 4 | This example is a work in progress and should not be considered a final specification 5 | or recommendation for guidance. This example will help guide and direct the process 6 | of finding conventions and usage patterns that meet the needs of the various stakeholders 7 | in the measure development community. 8 | */ 9 | 10 | /* 11 | @update: @@BTR 2020-03-31 -> 12 | Incremented version to 2.0.000 13 | Updated FHIR version to 4.0.1 14 | @@@ 15 | */ 16 | 17 | using FHIR version '4.0.1' 18 | 19 | include MATGlobalCommonFunctions version '5.0.000' called Global 20 | include FHIRHelpers version '4.0.1' called FHIRHelpers 21 | 22 | codesystem "SNOMEDCT:2017-09": 'http://snomed.info/sct/731000124108' version 'http://snomed.info/sct/731000124108/version/201709' 23 | 24 | valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' 25 | valueset "Hospice care ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15' 26 | 27 | code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT:2017-09" display 'Discharge to healthcare facility for hospice care (procedure)' 28 | code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT:2017-09" display 'Discharge to home for hospice care (procedure)' 29 | 30 | parameter "Measurement Period" Interval<DateTime> 31 | default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0) 32 | 33 | context Patient 34 | 35 | define "Has Hospice": 36 | exists ( 37 | [Encounter: "Encounter Inpatient"] DischargeHospice 38 | where DischargeHospice.status = 'finished' 39 | and ( 40 | DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)" 41 | or DischargeHospice.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)" 42 | ) 43 | and DischargeHospice.period ends during "Measurement Period" 44 | ) 45 | or exists ( 46 | [ServiceRequest: "Hospice care ambulatory"] HospiceOrder 47 | where HospiceOrder.intent = 'order' 48 | and HospiceOrder.authoredOn in "Measurement Period" 49 | ) 50 | or exists ( 51 | [Procedure: "Hospice care ambulatory"] HospicePerformed 52 | where HospicePerformed.status = 'completed' 53 | and Global."Normalize Interval"(HospicePerformed.performed) overlaps "Measurement Period" 54 | ) 55 | -------------------------------------------------------------------------------- /pages/cql/release/fhir401/SupplementalDataElements-2.0.0.cql: -------------------------------------------------------------------------------- 1 | library SupplementalDataElements version '2.0.0' 2 | 3 | using FHIR version '4.0.1' 4 | 5 | include FHIRHelpers version '4.0.1' called FHIRHelpers 6 | 7 | valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' 8 | valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' 9 | valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' 10 | valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' 11 | 12 | context Patient 13 | 14 | define "SDE Ethnicity": 15 | (flatten ( 16 | Patient.extension Extension 17 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' 18 | return Extension.extension 19 | )) E 20 | where E.url = 'ombCategory' 21 | or E.url = 'detailed' 22 | return E.value as Coding 23 | 24 | define "SDE Payer": 25 | [Coverage: type in "Payer"] Payer 26 | return { 27 | code: Payer.type, 28 | period: Payer.period 29 | } 30 | 31 | define "SDE Race": 32 | (flatten ( 33 | Patient.extension Extension 34 | where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' 35 | return Extension.extension 36 | )) E 37 | where E.url = 'ombCategory' 38 | or E.url = 'detailed' 39 | return E.value as Coding 40 | 41 | define "SDE Sex": 42 | case 43 | when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } 44 | when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } 45 | else null 46 | end 47 | -------------------------------------------------------------------------------- /pages/downloads.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | <a name="downloads"> </a> 10 | <h2><span class="sectioncount">7.0.0</span> Downloads <a href="downloads.html#downloads" title="link to here" class="self-link"> <img src="target.png" width="20" class="self-link" height="20"/></a></h2> 11 | 12 | <h3>Validator Pack</h3> 13 | 14 | <p>The following file contains all value sets, profiles, extensions, pages, etc. in this Implementation Guide:</p> 15 | 16 | <ul><li><a href="validator.pack">Validator Pack</a></li></ul> 17 | 18 | <h3>Definitions</h3> 19 | 20 | <p> 21 | In addition to the above, we have provided format-specific <em>definitions</em>: 22 | <ul> 23 | <li><a href="definitions.xml.zip">XML</a></li> 24 | <li><a href="definitions.json.zip">JSON</a></li> 25 | <li><a href="definitions.ttl.zip">TTL</a></li> 26 | </ul> 27 | </p> 28 | 29 | <p> 30 | These files should be the first choice whenever generating any implementation artifacts since they contain all of the rules about what makes these US Core profiles valid. 31 | Implementers will still need to be familiar with the content of the specification and profiles that apply in order to make a conformant implementation. 32 | See the overview on <a href="http://hl7.org/fhir/validation.html">validating FHIR profiles and resources</a> for more information about validating profiles and how to use these artifacts. 33 | </p> 34 | 35 | <h3>Schematrons</h3> 36 | 37 | <p>Schematrons are also available and listed below:</p> 38 | 39 | <ul> 40 | <li>TODO</li> 41 | </ul> 42 | 43 | <h3>Examples</h3> 44 | 45 | <p> 46 | All examples used in this Implementation Guide: 47 | </p> 48 | 49 | <ul> 50 | <li><a href="examples.xml.zip">XML</a></li> 51 | <li><a href="examples.json.zip">JSON</a></li> 52 | <li><a href="examples.ttl.zip">TTl</a></li> 53 | </ul> 54 | 55 | {% include container-end.html %} 56 | 57 | {% include footer.html %} -------------------------------------------------------------------------------- /pages/elm/exm-logic-1.0.0.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cqframework/draft-measures/b4c6829c0a91f48171964f09d587acb834c332b3/pages/elm/exm-logic-1.0.0.xml -------------------------------------------------------------------------------- /pages/history.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: History 4 | --- 5 | 6 | This table provides a list of all the versions of FHIR versions of the {{site.data.fhir.igName}} Implementation Guide that are available. See [FHIR Releases and Versioning](http://build.fhir.org/versions.html#versions) for a description of how the versioning of this Implementation Guide is managed. As well, this guide follow the general definitions and guidelines outlined in [Rules for Inter-version change](http://build.fhir.org/versions.html#change): 7 | 8 | |Date|Version|Description| 9 | |---|---|---| 10 | |**Current Versions**| 11 | |n/a|n/a|No published version yet| 12 | |[current](http://build.fhir.org/ig/HL7/draft-measures)|(last commit)|Current Development build (may be incoherent and change rapidly)| 13 | |**STU1 sequence**| 14 | |[May 2019](2019May/index.html)|0.1.0|STU1 Ballot| 15 | -------------------------------------------------------------------------------- /pages/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | <a name="home" style="display:none;"> </a> 5 | 6 | <h2> 7 | <span class="sectioncount">1.0.0 </span> 8 | <span>Draft Measures</span> 9 | <a href="index.html#home" title="link to here" class="self-link"><img src="target.png" width="20" class="self-link" height="20"/></a> 10 | </h2> 11 | 12 | <h3>Summary</h3> 13 | 14 | <p>This implementation guide provides draft measure content. Measures in this implementation guide are examples and works in progress and should not be considered final specifications or recommendations for clinical guidance. These examples will help guide and direct the process of finding conventions and usage patterns that meet the needs of the various stakeholders in the measure development community.</p> 15 | 16 | <p>The measures examples here conform to the <a href="http://hl7.org/fhir/us/cqfmeasures">FHIR Quality Measure Implementation Guide</a> and use the profiles defined in <a href="http://hl7.org/fhir/us/qicore">QI-Core</a>.</p> 17 | 18 | <h3>How to read this Guide</h3> 19 | <p>This Guide is divided into several pages which are listed at the top of each page in the menu bar:</p> 20 | 21 | <ul> 22 | <li><b><a href="index.html">Home</a></b></li> 23 | <li><b><a href="examples.html">Examples</a></b>: This page lists the examples contained in this implementation guide.</li> 24 | <li><b><a href="downloads.html">Downloads</a></b>: This page provides links to downloadable artifacts for implementations.</li> 25 | </ul> 26 | 27 | -------------------------------------------------------------------------------- /pages/jquery-ui.structure.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.11.1 3 | * http://jqueryui.com 4 | * 5 | * Copyright 2014 jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | 12 | /* Layout helpers 13 | ----------------------------------*/ 14 | .ui-helper-hidden { 15 | display: none; 16 | } 17 | .ui-helper-hidden-accessible { 18 | border: 0; 19 | clip: rect(0 0 0 0); 20 | height: 1px; 21 | margin: -1px; 22 | overflow: hidden; 23 | padding: 0; 24 | position: absolute; 25 | width: 1px; 26 | } 27 | .ui-helper-reset { 28 | margin: 0; 29 | padding: 0; 30 | border: 0; 31 | outline: 0; 32 | line-height: 1.3; 33 | text-decoration: none; 34 | font-size: 100%; 35 | list-style: none; 36 | } 37 | .ui-helper-clearfix:before, 38 | .ui-helper-clearfix:after { 39 | content: ""; 40 | display: table; 41 | border-collapse: collapse; 42 | } 43 | .ui-helper-clearfix:after { 44 | clear: both; 45 | } 46 | .ui-helper-clearfix { 47 | min-height: 0; /* support: IE7 */ 48 | } 49 | .ui-helper-zfix { 50 | width: 100%; 51 | height: 100%; 52 | top: 0; 53 | left: 0; 54 | position: absolute; 55 | opacity: 0; 56 | filter:Alpha(Opacity=0); /* support: IE8 */ 57 | } 58 | 59 | .ui-front { 60 | z-index: 100; 61 | } 62 | 63 | 64 | /* Interaction Cues 65 | ----------------------------------*/ 66 | .ui-state-disabled { 67 | cursor: default !important; 68 | } 69 | 70 | 71 | /* Icons 72 | ----------------------------------*/ 73 | 74 | /* states and images */ 75 | .ui-icon { 76 | display: block; 77 | text-indent: -99999px; 78 | overflow: hidden; 79 | background-repeat: no-repeat; 80 | } 81 | 82 | 83 | /* Misc visuals 84 | ----------------------------------*/ 85 | 86 | /* Overlays */ 87 | .ui-widget-overlay { 88 | position: fixed; 89 | top: 0; 90 | left: 0; 91 | width: 100%; 92 | height: 100%; 93 | } 94 | .ui-tabs { 95 | position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 96 | padding: .2em; 97 | } 98 | .ui-tabs .ui-tabs-nav { 99 | margin: 0; 100 | padding: .2em .2em 0; 101 | } 102 | .ui-tabs .ui-tabs-nav li { 103 | list-style: none; 104 | float: left; 105 | position: relative; 106 | top: 0; 107 | margin: 1px .2em 0 0; 108 | border-bottom-width: 0; 109 | padding: 0; 110 | white-space: nowrap; 111 | } 112 | .ui-tabs .ui-tabs-nav .ui-tabs-anchor { 113 | float: left; 114 | padding: .5em 1em; 115 | text-decoration: none; 116 | } 117 | .ui-tabs .ui-tabs-nav li.ui-tabs-active { 118 | margin-bottom: -1px; 119 | padding-bottom: 1px; 120 | } 121 | .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, 122 | .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, 123 | .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { 124 | cursor: text; 125 | } 126 | .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { 127 | cursor: pointer; 128 | } 129 | .ui-tabs .ui-tabs-panel { 130 | display: block; 131 | border-width: 0; 132 | padding: 1em 1.4em; 133 | background: none; 134 | } 135 | -------------------------------------------------------------------------------- /pages/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.11.1 - 2014-10-13 2 | * http://jqueryui.com 3 | * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none} -------------------------------------------------------------------------------- /pages/libraries.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | <a name="libraries"> </a> 10 | <h2><span class="sectioncount">2.0.0</span> Libaries <a href="libraries.html#libraries" title="link to here" class="self-link"><img src="target.png" width="20" class="self-link" height="20"/></a></h2> 11 | 12 | <table class="grid"> 13 | <thead> 14 | <tr> 15 | <th>Library</th><th>Description</th> 16 | </tr> 17 | </thead> 18 | <tbody> 19 | {% include table-libraries.xhtml %} 20 | </tbody> 21 | </table> 22 | 23 | {% include container-end.html %} 24 | 25 | {% include footer.html %} -------------------------------------------------------------------------------- /pages/measure-test-patients.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | <!-- ==============START CONTENT START CONTENT=================== --> 10 | 11 | 12 | <a name="measure-test-patients"> </a> 13 | <h2><span class="sectioncount">8.0.0</span> Test Patients For CQF Measure Libraries <a href="measure-test-patients.html#measure-test-patients" title="link to here" class="self-link"> <img src="target.png" width="20" class="self-link" height="20"/></a></h2> 14 | 15 | 16 | {% include container-end.html %} 17 | 18 | {% include footer.html %} -------------------------------------------------------------------------------- /pages/measures.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | <a name="measures"> </a> 10 | <h2><span class="sectioncount">3.0.0</span> Measures <a href="measures.html#measures" title="link to here" class="self-link"><img src="target.png" width="20" class="self-link" height="20"/></a></h2> 11 | 12 | <table class="grid"> 13 | <thead> 14 | <tr> 15 | <th>Measure</th><th>Description</th> 16 | </tr> 17 | </thead> 18 | <tbody> 19 | {% include table-measures.xhtml %} 20 | </tbody> 21 | </table> 22 | 23 | {% include container-end.html %} 24 | 25 | {% include footer.html %} 26 | -------------------------------------------------------------------------------- /pages/registry.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll prompt 3 | --- 4 | <!DOCTYPE HTML> 5 | 6 | 7 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 8 | <head> 9 | <meta charset="UTF-8"/> 10 | <title>Registry 11 | 12 | {% include header.html %} 13 | 14 | 15 | 16 | {% include navbar.html %} 17 | 18 |
19 |
20 | 26 |
27 |
28 | 29 |
30 |
31 |
32 |
33 | 34 | 35 | 36 |
37 | 38 |

Conformance Resource Registry

39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | {% include table-libraries.xhtml %} 48 | {% include table-measures.xhtml %} 49 | 50 |
ResourceDescription
51 | 52 |
53 | 54 | 55 |
56 |
57 |
58 | 59 |
60 | 61 | 62 | {% include footer.html %} 63 | 64 | 65 | -------------------------------------------------------------------------------- /pages/terminology.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | 8 | 9 | {% include container-start.html %} 10 | 11 | 12 | 13 | 14 |

6.0.0 Terminology

15 | 16 | 17 |

18 | 6.1.0 CodeSystems 19 | 20 | 21 | 22 |

23 | 24 | 25 |

26 | 6.2.0 ValueSets 27 | 28 | 29 | 30 |

31 | 32 | 33 | 34 | {% include container-end.html %} 35 | 36 | {% include footer.html %} -------------------------------------------------------------------------------- /pages/test-data.html: -------------------------------------------------------------------------------- 1 | --- 2 | # jekyll header 3 | --- 4 | 5 | {% include header.html %} 6 | 7 | {% include container-start.html %} 8 | 9 | 10 | 11 | {% include container-end.html %} 12 | 13 | {% include footer.html %} -------------------------------------------------------------------------------- /resources/draft-measures-profile-introduction.xml: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |

Scope and Usage

6 |
7 | 8 |
9 | -------------------------------------------------------------------------------- /resources/draft-profile-notes.xml: -------------------------------------------------------------------------------- 1 | 
2 | 3 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /resources/library/library-fhir-model-definition-FHIR2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Library", 3 | "id": "library-fhir-model-definition-FHIR2", 4 | "url": "http://hl7.org/fhir/Library/library-fhir-model-definition", 5 | "identifier": [ 6 | { 7 | "use": "official", 8 | "system": "http://example.org/fhir/cqi/ecqm/Library/Identifier", 9 | "value": "FHIR" 10 | } 11 | ], 12 | "version": "1.0.2", 13 | "name": "FHIR", 14 | "title": "FHIR Model Definition", 15 | "status": "active", 16 | "type": { 17 | "coding": [ 18 | { 19 | "system": "http://hl7.org/fhir/library-type", 20 | "code": "model-definition" 21 | } 22 | ] 23 | }, 24 | "date": "2016-07-08", 25 | "publisher": "Health Level 7 International - Clinical Quality Information Work Group", 26 | "description": "Model definition for the DSTU2 FHIR Model", 27 | "approvalDate": "2016-07-08", 28 | "lastReviewDate": "2016-07-08", 29 | "contact": [ 30 | { 31 | "telecom": [ 32 | { 33 | "system": "url", 34 | "value": "http://www.hl7.org/Special/committees/cqi/index.cfm" 35 | } 36 | ] 37 | } 38 | ], 39 | "topic": [ 40 | { 41 | "text": "FHIR" 42 | } 43 | ], 44 | "content": [ 45 | { 46 | "contentType": "application/xml", 47 | "url": "https://cqlrepository.org/fhir-modelinfo-1.0.2.xml" 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /resources/library/library-fhir-model-definition.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Library", 3 | "id": "library-fhir-model-definition", 4 | "url": "http://hl7.org/fhir/Library/library-fhir-model-definition", 5 | "identifier": [ 6 | { 7 | "use": "official", 8 | "system": "http://example.org/fhir/cqi/ecqm/Library/Identifier", 9 | "value": "FHIR" 10 | } 11 | ], 12 | "version": "3.0.0", 13 | "name": "FHIR", 14 | "title": "FHIR Model Definition", 15 | "status": "active", 16 | "type": { 17 | "coding": [ 18 | { 19 | "system": "http://hl7.org/fhir/library-type", 20 | "code": "model-definition" 21 | } 22 | ] 23 | }, 24 | "date": "2016-07-08", 25 | "publisher": "Health Level 7 International - Clinical Quality Information Work Group", 26 | "description": "Model definition for the DSTU2 FHIR Model", 27 | "approvalDate": "2016-07-08", 28 | "lastReviewDate": "2016-07-08", 29 | "contact": [ 30 | { 31 | "telecom": [ 32 | { 33 | "system": "url", 34 | "value": "http://www.hl7.org/Special/committees/cqi/index.cfm" 35 | } 36 | ] 37 | } 38 | ], 39 | "topic": [ 40 | { 41 | "text": "FHIR" 42 | } 43 | ], 44 | "content": [ 45 | { 46 | "contentType": "application/xml", 47 | "url": "https://cqlrepository.org/fhir-modelinfo-3.0.0.xml" 48 | } 49 | ] 50 | } 51 | --------------------------------------------------------------------------------