library BreastCancerScreeningFHIR version '0.0.001' using QICore version '4.1.1' include SupplementalDataElements version '3.4.000' called SDE include QICoreCommon version '2.0.000' called QICoreCommon include AdultOutpatientEncounters version '4.8.000' called AdultOutpatientEncounters include Hospice version '6.9.000' called Hospice include Status version '1.6.000' called Status include PalliativeCare version '1.9.000' called PalliativeCare include AdvancedIllnessandFrailty version '1.8.000' called AIFrailLTCF codesystem "AdministrativeGender": 'http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender' codesystem "SNOMEDCT": 'http://snomed.info/sct' codesystem "LOINC": 'http://loinc.org' valueset "Bilateral Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1005' valueset "History of bilateral mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1068' valueset "Mammography": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1018' valueset "Outpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087' valueset "Status Post Left Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1069' valueset "Status Post Right Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1070' valueset "Unilateral Mastectomy Left": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1133' valueset "Unilateral Mastectomy Right": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1134' valueset "Unilateral Mastectomy, Unspecified Laterality": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1071' code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT" display 'Discharge to healthcare facility for hospice care (procedure)' code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT" display 'Discharge to home for hospice care (procedure)' code "Female": 'F' from "AdministrativeGender" display 'Female' code "Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)": '71007-9' from "LOINC" display 'Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)' code "Hospice care [Minimum Data Set]": '45755-6' from "LOINC" display 'Hospice care [Minimum Data Set]' code "Housing status": '71802-3' from "LOINC" display 'Housing status' code "Left (qualifier value)": '7771000' from "SNOMEDCT" display 'Left (qualifier value)' code "Lives in a nursing home (finding)": '160734000' from "SNOMEDCT" display 'Lives in a nursing home (finding)' code "Medical equipment used": '98181-1' from "LOINC" display 'Medical equipment used' code "Right (qualifier value)": '24028007' from "SNOMEDCT" display 'Right (qualifier value)' code "Yes (qualifier value)": '373066001' from "SNOMEDCT" display 'Yes (qualifier value)' parameter "Measurement Period" Interval context Patient define "Initial Population": AgeInYearsAt(date from end of "Measurement Period" )in Interval[52, 74] and Patient.gender = 'female' and exists AdultOutpatientEncounters."Qualifying Encounters" define "Denominator": "Initial Population" define "Denominator Exclusions": Hospice."Has Hospice Services" or ( ( exists ( "Right Mastectomy Diagnosis" ) or exists ( "Right Mastectomy Procedure" ) ) and ( exists ( "Left Mastectomy Diagnosis" ) or exists ( "Left Mastectomy Procedure" ) ) ) or exists "Bilateral Mastectomy Diagnosis" or exists "Bilateral Mastectomy Procedure" or AIFrailLTCF."Is Age 66 or Older with Advanced Illness and Frailty" or AIFrailLTCF."Is Age 66 or Older Living Long Term in a Nursing Home" or PalliativeCare."Has Palliative Care in the Measurement Period" define "Right Mastectomy Diagnosis": ( [Condition: "Status Post Right Mastectomy"] RightMastectomyProcedure union ( [Condition: "Unilateral Mastectomy, Unspecified Laterality"] UnilateralMastectomyDiagnosis // where "Right (qualifier value)" in UnilateralMastectomyDiagnosis.bodySite ) ) RightMastectomy where RightMastectomy.prevalenceInterval() starts on or before end of "Measurement Period" define "Right Mastectomy Procedure": (([Procedure: "Unilateral Mastectomy Right"]).isProcedurePerformed()) UnilateralMastectomyRightPerformed // where UnilateralMastectomyRightPerformed.performed.toInterval() ends on or before // end of "Measurement Period" define "Left Mastectomy Diagnosis": ( [Condition: "Status Post Left Mastectomy"] union ( [Condition: "Unilateral Mastectomy, Unspecified Laterality"] UnilateralMastectomyDiagnosis // where "Left (qualifier value)" in UnilateralMastectomyDiagnosis.bodySite ) ) LeftMastectomy where LeftMastectomy.prevalenceInterval() starts on or before end of "Measurement Period" define "Left Mastectomy Procedure": (([Procedure: "Unilateral Mastectomy Left"]).isProcedurePerformed()) UnilateralMastectomyLeftPerformed // where UnilateralMastectomyLeftPerformed.performed.toInterval() ends on or before // end of "Measurement Period" define "Bilateral Mastectomy Diagnosis": [Condition: "History of bilateral mastectomy"] BilateralMastectomyHistory where BilateralMastectomyHistory.prevalenceInterval() starts on or before end of "Measurement Period" define "Bilateral Mastectomy Procedure": (([Procedure: "Bilateral Mastectomy"]).isProcedurePerformed()) BilateralMastectomyPerformed where BilateralMastectomyPerformed.performed.toInterval() ends on or before end of "Measurement Period" define "Numerator": exists ((([Observation: "Mammography"]).isDiagnosticStudyPerformed()) Mammogram // where Mammogram.effective.toInterval() ends during day of Interval["October 1 Two Years Prior to the Measurement Period", // end of "Measurement Period"] ) define "October 1 Two Years Prior to the Measurement Period": DateTime((year from start of "Measurement Period" - 2), 10, 1, 0, 0, 0, 0, 0) define "SDE Ethnicity": SDE."SDE Ethnicity" define "SDE Payer": SDE."SDE Payer" define "SDE Race": SDE."SDE Race" define "SDE Sex": SDE."SDE Sex"