diff --git a/Demo/Measures/AdultOutpatientEncountersFHIR4-2.2.000.cs b/Demo/Measures/AdultOutpatientEncountersFHIR4-2.2.000.cs index e1701af7a..7f2eef73f 100644 --- a/Demo/Measures/AdultOutpatientEncountersFHIR4-2.2.000.cs +++ b/Demo/Measures/AdultOutpatientEncountersFHIR4-2.2.000.cs @@ -14,96 +14,43 @@ public class AdultOutpatientEncountersFHIR4_2_2_000 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __Annual_Wellness_Visit; - internal Lazy __Home_Healthcare_Services; - internal Lazy __Office_Visit; - internal Lazy __Preventive_Care_Services___Established_Office_Visit__18_and_Up; - internal Lazy __Preventive_Care_Services_Initial_Office_Visit__18_and_Up; - internal Lazy> __Measurement_Period; - internal Lazy __Patient; - internal Lazy> __Qualifying_Encounters; - - #endregion - public AdultOutpatientEncountersFHIR4_2_2_000(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - MATGlobalCommonFunctionsFHIR4_6_1_000 = new MATGlobalCommonFunctionsFHIR4_6_1_000(context); - - __Annual_Wellness_Visit = new Lazy(this.Annual_Wellness_Visit_Value); - __Home_Healthcare_Services = new Lazy(this.Home_Healthcare_Services_Value); - __Office_Visit = new Lazy(this.Office_Visit_Value); - __Preventive_Care_Services___Established_Office_Visit__18_and_Up = new Lazy(this.Preventive_Care_Services___Established_Office_Visit__18_and_Up_Value); - __Preventive_Care_Services_Initial_Office_Visit__18_and_Up = new Lazy(this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up_Value); - __Measurement_Period = new Lazy>(this.Measurement_Period_Value); - __Patient = new Lazy(this.Patient_Value); - __Qualifying_Encounters = new Lazy>(this.Qualifying_Encounters_Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - public MATGlobalCommonFunctionsFHIR4_6_1_000 MATGlobalCommonFunctionsFHIR4_6_1_000 { get; } - - #endregion - - private CqlValueSet Annual_Wellness_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240", null); + public static AdultOutpatientEncountersFHIR4_2_2_000 Instance { get; } = new(); [CqlDeclaration("Annual Wellness Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240")] - public CqlValueSet Annual_Wellness_Visit() => - __Annual_Wellness_Visit.Value; - - private CqlValueSet Home_Healthcare_Services_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016", null); + public CqlValueSet Annual_Wellness_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240", null); [CqlDeclaration("Home Healthcare Services")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016")] - public CqlValueSet Home_Healthcare_Services() => - __Home_Healthcare_Services.Value; - - private CqlValueSet Office_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001", null); + public CqlValueSet Home_Healthcare_Services(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016", null); [CqlDeclaration("Office Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001")] - public CqlValueSet Office_Visit() => - __Office_Visit.Value; - - private CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025", null); + public CqlValueSet Office_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001", null); [CqlDeclaration("Preventive Care Services - Established Office Visit, 18 and Up")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025")] - public CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up() => - __Preventive_Care_Services___Established_Office_Visit__18_and_Up.Value; - - private CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023", null); + public CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025", null); [CqlDeclaration("Preventive Care Services-Initial Office Visit, 18 and Up")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023")] - public CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up() => - __Preventive_Care_Services_Initial_Office_Visit__18_and_Up.Value; + public CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023", null); - private CqlInterval Measurement_Period_Value() + [CqlDeclaration("Measurement Period")] + public CqlInterval Measurement_Period(CqlContext context) { var a_ = context.ResolveParameter("AdultOutpatientEncountersFHIR4-2.2.000", "Measurement Period", null); return (CqlInterval)a_; } - [CqlDeclaration("Measurement Period")] - public CqlInterval Measurement_Period() => - __Measurement_Period.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -111,32 +58,29 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - - private IEnumerable Qualifying_Encounters_Value() + [CqlDeclaration("Qualifying Encounters")] + public IEnumerable Qualifying_Encounters(CqlContext context) { - var a_ = this.Office_Visit(); + var a_ = this.Office_Visit(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Annual_Wellness_Visit(); + var c_ = this.Annual_Wellness_Visit(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); var e_ = context.Operators.ListUnion(b_, d_); - var f_ = this.Preventive_Care_Services___Established_Office_Visit__18_and_Up(); + var f_ = this.Preventive_Care_Services___Established_Office_Visit__18_and_Up(context); var g_ = context.Operators.RetrieveByValueSet(f_, null); - var h_ = this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up(); + var h_ = this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up(context); var i_ = context.Operators.RetrieveByValueSet(h_, null); var j_ = context.Operators.ListUnion(g_, i_); var k_ = context.Operators.ListUnion(e_, j_); - var l_ = this.Home_Healthcare_Services(); + var l_ = this.Home_Healthcare_Services(context); var m_ = context.Operators.RetrieveByValueSet(l_, null); var n_ = context.Operators.ListUnion(k_, m_); bool? o_(Encounter ValidEncounter) { var q_ = context.Operators.Convert(ValidEncounter?.StatusElement); var r_ = context.Operators.Equal(q_, "finished"); - var s_ = this.Measurement_Period(); - var t_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((ValidEncounter?.Period as object)); + var s_ = this.Measurement_Period(context); + var t_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (ValidEncounter?.Period as object)); var u_ = context.Operators.IntervalIncludesInterval(s_, t_, null); var v_ = context.Operators.And(r_, u_); @@ -147,8 +91,4 @@ private IEnumerable Qualifying_Encounters_Value() return p_; } - [CqlDeclaration("Qualifying Encounters")] - public IEnumerable Qualifying_Encounters() => - __Qualifying_Encounters.Value; - } \ No newline at end of file diff --git a/Demo/Measures/AdvancedIllnessandFrailtyExclusionECQMFHIR4-5.17.000.cs b/Demo/Measures/AdvancedIllnessandFrailtyExclusionECQMFHIR4-5.17.000.cs index 83ee0d623..4af257472 100644 --- a/Demo/Measures/AdvancedIllnessandFrailtyExclusionECQMFHIR4-5.17.000.cs +++ b/Demo/Measures/AdvancedIllnessandFrailtyExclusionECQMFHIR4-5.17.000.cs @@ -14,200 +14,83 @@ public class AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __Acute_Inpatient; - internal Lazy __Advanced_Illness; - internal Lazy __Care_Services_in_Long_Term_Residential_Facility; - internal Lazy __Dementia_Medications; - internal Lazy __Emergency_Department_Visit; - internal Lazy __Frailty_Device; - internal Lazy __Frailty_Diagnosis; - internal Lazy __Frailty_Encounter; - internal Lazy __Frailty_Symptom; - internal Lazy __Nonacute_Inpatient; - internal Lazy __Nursing_Facility_Visit; - internal Lazy __Observation; - internal Lazy __Outpatient; - internal Lazy> __Measurement_Period; - internal Lazy __Patient; - internal Lazy> __Dementia_Medications_In_Year_Before_or_During_Measurement_Period; - internal Lazy>> __Long_Term_Care_Periods_During_Measurement_Period; - internal Lazy> __Outpatient_Encounters_with_Advanced_Illness; - internal Lazy> __Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service; - internal Lazy>> __Long_Term_Care_Overlapping_Periods; - internal Lazy>> __Long_Term_Care_Adjacent_Periods; - internal Lazy __Max_Long_Term_Care_Period_Length; - internal Lazy> __Inpatient_Encounter_with_Advanced_Illness; - internal Lazy __Has_Criteria_Indicating_Frailty; - internal Lazy __Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80; - internal Lazy __Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80; - internal Lazy __Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days; - - #endregion - public AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - MATGlobalCommonFunctionsFHIR4_6_1_000 = new MATGlobalCommonFunctionsFHIR4_6_1_000(context); - CumulativeMedicationDurationFHIR4_1_0_000 = new CumulativeMedicationDurationFHIR4_1_0_000(context); - - __Acute_Inpatient = new Lazy(this.Acute_Inpatient_Value); - __Advanced_Illness = new Lazy(this.Advanced_Illness_Value); - __Care_Services_in_Long_Term_Residential_Facility = new Lazy(this.Care_Services_in_Long_Term_Residential_Facility_Value); - __Dementia_Medications = new Lazy(this.Dementia_Medications_Value); - __Emergency_Department_Visit = new Lazy(this.Emergency_Department_Visit_Value); - __Frailty_Device = new Lazy(this.Frailty_Device_Value); - __Frailty_Diagnosis = new Lazy(this.Frailty_Diagnosis_Value); - __Frailty_Encounter = new Lazy(this.Frailty_Encounter_Value); - __Frailty_Symptom = new Lazy(this.Frailty_Symptom_Value); - __Nonacute_Inpatient = new Lazy(this.Nonacute_Inpatient_Value); - __Nursing_Facility_Visit = new Lazy(this.Nursing_Facility_Visit_Value); - __Observation = new Lazy(this.Observation_Value); - __Outpatient = new Lazy(this.Outpatient_Value); - __Measurement_Period = new Lazy>(this.Measurement_Period_Value); - __Patient = new Lazy(this.Patient_Value); - __Dementia_Medications_In_Year_Before_or_During_Measurement_Period = new Lazy>(this.Dementia_Medications_In_Year_Before_or_During_Measurement_Period_Value); - __Long_Term_Care_Periods_During_Measurement_Period = new Lazy>>(this.Long_Term_Care_Periods_During_Measurement_Period_Value); - __Outpatient_Encounters_with_Advanced_Illness = new Lazy>(this.Outpatient_Encounters_with_Advanced_Illness_Value); - __Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service = new Lazy>(this.Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service_Value); - __Long_Term_Care_Overlapping_Periods = new Lazy>>(this.Long_Term_Care_Overlapping_Periods_Value); - __Long_Term_Care_Adjacent_Periods = new Lazy>>(this.Long_Term_Care_Adjacent_Periods_Value); - __Max_Long_Term_Care_Period_Length = new Lazy(this.Max_Long_Term_Care_Period_Length_Value); - __Inpatient_Encounter_with_Advanced_Illness = new Lazy>(this.Inpatient_Encounter_with_Advanced_Illness_Value); - __Has_Criteria_Indicating_Frailty = new Lazy(this.Has_Criteria_Indicating_Frailty_Value); - __Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80 = new Lazy(this.Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80_Value); - __Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80 = new Lazy(this.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80_Value); - __Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days = new Lazy(this.Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days_Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - public MATGlobalCommonFunctionsFHIR4_6_1_000 MATGlobalCommonFunctionsFHIR4_6_1_000 { get; } - public CumulativeMedicationDurationFHIR4_1_0_000 CumulativeMedicationDurationFHIR4_1_0_000 { get; } - - #endregion - - private CqlValueSet Acute_Inpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083", null); + public static AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 Instance { get; } = new(); [CqlDeclaration("Acute Inpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083")] - public CqlValueSet Acute_Inpatient() => - __Acute_Inpatient.Value; - - private CqlValueSet Advanced_Illness_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082", null); + public CqlValueSet Acute_Inpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083", null); [CqlDeclaration("Advanced Illness")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082")] - public CqlValueSet Advanced_Illness() => - __Advanced_Illness.Value; - - private CqlValueSet Care_Services_in_Long_Term_Residential_Facility_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014", null); + public CqlValueSet Advanced_Illness(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082", null); [CqlDeclaration("Care Services in Long-Term Residential Facility")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014")] - public CqlValueSet Care_Services_in_Long_Term_Residential_Facility() => - __Care_Services_in_Long_Term_Residential_Facility.Value; - - private CqlValueSet Dementia_Medications_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510", null); + public CqlValueSet Care_Services_in_Long_Term_Residential_Facility(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014", null); [CqlDeclaration("Dementia Medications")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510")] - public CqlValueSet Dementia_Medications() => - __Dementia_Medications.Value; - - private CqlValueSet Emergency_Department_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010", null); + public CqlValueSet Dementia_Medications(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510", null); [CqlDeclaration("Emergency Department Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010")] - public CqlValueSet Emergency_Department_Visit() => - __Emergency_Department_Visit.Value; - - private CqlValueSet Frailty_Device_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300", null); + public CqlValueSet Emergency_Department_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010", null); [CqlDeclaration("Frailty Device")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300")] - public CqlValueSet Frailty_Device() => - __Frailty_Device.Value; - - private CqlValueSet Frailty_Diagnosis_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074", null); + public CqlValueSet Frailty_Device(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300", null); [CqlDeclaration("Frailty Diagnosis")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074")] - public CqlValueSet Frailty_Diagnosis() => - __Frailty_Diagnosis.Value; - - private CqlValueSet Frailty_Encounter_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088", null); + public CqlValueSet Frailty_Diagnosis(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074", null); [CqlDeclaration("Frailty Encounter")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088")] - public CqlValueSet Frailty_Encounter() => - __Frailty_Encounter.Value; - - private CqlValueSet Frailty_Symptom_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075", null); + public CqlValueSet Frailty_Encounter(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088", null); [CqlDeclaration("Frailty Symptom")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075")] - public CqlValueSet Frailty_Symptom() => - __Frailty_Symptom.Value; - - private CqlValueSet Nonacute_Inpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084", null); + public CqlValueSet Frailty_Symptom(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075", null); [CqlDeclaration("Nonacute Inpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084")] - public CqlValueSet Nonacute_Inpatient() => - __Nonacute_Inpatient.Value; - - private CqlValueSet Nursing_Facility_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012", null); + public CqlValueSet Nonacute_Inpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084", null); [CqlDeclaration("Nursing Facility Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012")] - public CqlValueSet Nursing_Facility_Visit() => - __Nursing_Facility_Visit.Value; - - private CqlValueSet Observation_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086", null); + public CqlValueSet Nursing_Facility_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012", null); [CqlDeclaration("Observation")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086")] - public CqlValueSet Observation() => - __Observation.Value; - - private CqlValueSet Outpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087", null); + public CqlValueSet Observation(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086", null); [CqlDeclaration("Outpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087")] - public CqlValueSet Outpatient() => - __Outpatient.Value; + public CqlValueSet Outpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087", null); - private CqlInterval Measurement_Period_Value() + [CqlDeclaration("Measurement Period")] + public CqlInterval Measurement_Period(CqlContext context) { var a_ = context.ResolveParameter("AdvancedIllnessandFrailtyExclusionECQMFHIR4-5.17.000", "Measurement Period", null); return (CqlInterval)a_; } - [CqlDeclaration("Measurement Period")] - public CqlInterval Measurement_Period() => - __Measurement_Period.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -215,13 +98,10 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - - private IEnumerable Dementia_Medications_In_Year_Before_or_During_Measurement_Period_Value() + [CqlDeclaration("Dementia Medications In Year Before or During Measurement Period")] + public IEnumerable Dementia_Medications_In_Year_Before_or_During_Measurement_Period(CqlContext context) { - var a_ = this.Dementia_Medications(); + var a_ = this.Dementia_Medications(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); var d_ = context.Operators.RetrieveByValueSet(a_, null); var e_ = context.Operators.ListUnion(b_, d_); @@ -232,8 +112,8 @@ private IEnumerable Dementia_Medications_In_Year_Before_or_Du var j_ = context.Operators.Convert(DementiaMed?.IntentElement); var k_ = context.Operators.Equal(j_, "order"); var l_ = context.Operators.And(i_, k_); - var m_ = CumulativeMedicationDurationFHIR4_1_0_000.MedicationPeriod((DementiaMed as object)); - var n_ = this.Measurement_Period(); + var m_ = CumulativeMedicationDurationFHIR4_1_0_000.Instance.MedicationPeriod(context, (DementiaMed as object)); + var n_ = this.Measurement_Period(context); var o_ = context.Operators.Start(n_); var p_ = context.Operators.Quantity(1m, "year"); var q_ = context.Operators.Subtract(o_, p_); @@ -249,23 +129,20 @@ private IEnumerable Dementia_Medications_In_Year_Before_or_Du return g_; } - [CqlDeclaration("Dementia Medications In Year Before or During Measurement Period")] - public IEnumerable Dementia_Medications_In_Year_Before_or_During_Measurement_Period() => - __Dementia_Medications_In_Year_Before_or_During_Measurement_Period.Value; - - private IEnumerable> Long_Term_Care_Periods_During_Measurement_Period_Value() + [CqlDeclaration("Long Term Care Periods During Measurement Period")] + public IEnumerable> Long_Term_Care_Periods_During_Measurement_Period(CqlContext context) { - var a_ = this.Care_Services_in_Long_Term_Residential_Facility(); + var a_ = this.Care_Services_in_Long_Term_Residential_Facility(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Nursing_Facility_Visit(); + var c_ = this.Nursing_Facility_Visit(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); var e_ = context.Operators.ListUnion(b_, d_); bool? f_(Encounter LongTermFacilityEncounter) { var j_ = context.Operators.Convert(LongTermFacilityEncounter?.StatusElement); var k_ = context.Operators.Equal(j_, "finished"); - var l_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((LongTermFacilityEncounter?.Period as object)); - var m_ = this.Measurement_Period(); + var l_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (LongTermFacilityEncounter?.Period as object)); + var m_ = this.Measurement_Period(context); var n_ = context.Operators.Overlaps(l_, m_, null); var o_ = context.Operators.And(k_, n_); @@ -274,8 +151,8 @@ private IEnumerable> Long_Term_Care_Periods_During_Meas var g_ = context.Operators.WhereOrNull(e_, f_); CqlInterval h_(Encounter LongTermFacilityEncounter) { - var p_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((LongTermFacilityEncounter?.Period as object)); - var q_ = this.Measurement_Period(); + var p_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (LongTermFacilityEncounter?.Period as object)); + var q_ = this.Measurement_Period(context); var r_ = context.Operators.IntervalIntersectsInterval(p_, q_); return r_; @@ -285,20 +162,17 @@ CqlInterval h_(Encounter LongTermFacilityEncounter) return i_; } - [CqlDeclaration("Long Term Care Periods During Measurement Period")] - public IEnumerable> Long_Term_Care_Periods_During_Measurement_Period() => - __Long_Term_Care_Periods_During_Measurement_Period.Value; - - private IEnumerable Outpatient_Encounters_with_Advanced_Illness_Value() + [CqlDeclaration("Outpatient Encounters with Advanced Illness")] + public IEnumerable Outpatient_Encounters_with_Advanced_Illness(CqlContext context) { - var a_ = this.Outpatient(); + var a_ = this.Outpatient(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Observation(); + var c_ = this.Observation(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); var e_ = context.Operators.ListUnion(b_, d_); - var f_ = this.Emergency_Department_Visit(); + var f_ = this.Emergency_Department_Visit(context); var g_ = context.Operators.RetrieveByValueSet(f_, null); - var h_ = this.Nonacute_Inpatient(); + var h_ = this.Nonacute_Inpatient(context); var i_ = context.Operators.RetrieveByValueSet(h_, null); var j_ = context.Operators.ListUnion(g_, i_); var k_ = context.Operators.ListUnion(e_, j_); @@ -312,15 +186,15 @@ private IEnumerable Outpatient_Encounters_with_Advanced_Illness_Value var m_ = context.Operators.WhereOrNull(k_, l_); IEnumerable n_(Encounter OutpatientEncounter) { - var r_ = this.Advanced_Illness(); + var r_ = this.Advanced_Illness(context); var s_ = context.Operators.RetrieveByValueSet(r_, null); bool? t_(Condition AdvancedIllnessDiagnosis) { - var x_ = MATGlobalCommonFunctionsFHIR4_6_1_000.EncounterDiagnosis(OutpatientEncounter); + var x_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.EncounterDiagnosis(context, OutpatientEncounter); var y_ = context.Operators.InList(AdvancedIllnessDiagnosis, x_); - var z_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((OutpatientEncounter?.Period as object)); + var z_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (OutpatientEncounter?.Period as object)); var aa_ = context.Operators.Start(z_); - var ab_ = this.Measurement_Period(); + var ab_ = this.Measurement_Period(context); var ac_ = context.Operators.End(ab_); var ad_ = context.Operators.Quantity(2m, "years"); var ae_ = context.Operators.Subtract(ac_, ad_); @@ -346,16 +220,13 @@ Encounter v_(Condition AdvancedIllnessDiagnosis) => return o_; } - [CqlDeclaration("Outpatient Encounters with Advanced Illness")] - public IEnumerable Outpatient_Encounters_with_Advanced_Illness() => - __Outpatient_Encounters_with_Advanced_Illness.Value; - - private IEnumerable Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service_Value() + [CqlDeclaration("Two Outpatient Encounters with Advanced Illness on Different Dates of Service")] + public IEnumerable Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service(CqlContext context) { - var a_ = this.Outpatient_Encounters_with_Advanced_Illness(); + var a_ = this.Outpatient_Encounters_with_Advanced_Illness(context); IEnumerable b_(Encounter _OutpatientEncounter1) { - var i_ = this.Outpatient_Encounters_with_Advanced_Illness(); + var i_ = this.Outpatient_Encounters_with_Advanced_Illness(context); return i_; }; @@ -372,9 +243,9 @@ Tuples.Tuple_EYKUVMTUWTABihhEAdHIGbSFe c_(Encounter _OutpatientEncounter1, Encou var d_ = context.Operators.SelectManyResultsOrNull(a_, b_, c_); bool? e_(Tuples.Tuple_EYKUVMTUWTABihhEAdHIGbSFe tuple_eykuvmtuwtabihheadhigbsfe) { - var k_ = FHIRHelpers_4_0_001.ToInterval(tuple_eykuvmtuwtabihheadhigbsfe.OutpatientEncounter2?.Period); + var k_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, tuple_eykuvmtuwtabihheadhigbsfe.OutpatientEncounter2?.Period); var l_ = context.Operators.End(k_); - var m_ = FHIRHelpers_4_0_001.ToInterval(tuple_eykuvmtuwtabihheadhigbsfe.OutpatientEncounter1?.Period); + var m_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, tuple_eykuvmtuwtabihheadhigbsfe.OutpatientEncounter1?.Period); var n_ = context.Operators.End(m_); var o_ = context.Operators.Quantity(1m, "day"); var p_ = context.Operators.Add(n_, o_); @@ -390,28 +261,22 @@ Encounter g_(Tuples.Tuple_EYKUVMTUWTABihhEAdHIGbSFe tuple_eykuvmtuwtabihheadhigb return h_; } - [CqlDeclaration("Two Outpatient Encounters with Advanced Illness on Different Dates of Service")] - public IEnumerable Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service() => - __Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service.Value; - - private IEnumerable> Long_Term_Care_Overlapping_Periods_Value() + [CqlDeclaration("Long Term Care Overlapping Periods")] + public IEnumerable> Long_Term_Care_Overlapping_Periods(CqlContext context) { - var a_ = this.Long_Term_Care_Periods_During_Measurement_Period(); + var a_ = this.Long_Term_Care_Periods_During_Measurement_Period(context); var b_ = context.Operators.Collapse(a_, null); return b_; } - [CqlDeclaration("Long Term Care Overlapping Periods")] - public IEnumerable> Long_Term_Care_Overlapping_Periods() => - __Long_Term_Care_Overlapping_Periods.Value; - - private IEnumerable> Long_Term_Care_Adjacent_Periods_Value() + [CqlDeclaration("Long Term Care Adjacent Periods")] + public IEnumerable> Long_Term_Care_Adjacent_Periods(CqlContext context) { - var a_ = this.Long_Term_Care_Overlapping_Periods(); + var a_ = this.Long_Term_Care_Overlapping_Periods(context); IEnumerable> b_(CqlInterval _LTCPeriod1) { - var i_ = this.Long_Term_Care_Overlapping_Periods(); + var i_ = this.Long_Term_Care_Overlapping_Periods(context); return i_; }; @@ -454,14 +319,11 @@ CqlInterval g_(Tuples.Tuple_IWAGVXGPWIVBAWDaHPGIVVBK tuple_iwagvxgp return h_; } - [CqlDeclaration("Long Term Care Adjacent Periods")] - public IEnumerable> Long_Term_Care_Adjacent_Periods() => - __Long_Term_Care_Adjacent_Periods.Value; - - private int? Max_Long_Term_Care_Period_Length_Value() + [CqlDeclaration("Max Long Term Care Period Length")] + public int? Max_Long_Term_Care_Period_Length(CqlContext context) { - var a_ = this.Long_Term_Care_Overlapping_Periods(); - var b_ = this.Long_Term_Care_Adjacent_Periods(); + var a_ = this.Long_Term_Care_Overlapping_Periods(context); + var b_ = this.Long_Term_Care_Adjacent_Periods(context); var c_ = context.Operators.ListUnion>(a_, b_); var d_ = context.Operators.Collapse(c_, null); int? e_(CqlInterval LTCPeriods) @@ -478,13 +340,10 @@ public IEnumerable> Long_Term_Care_Adjacent_Periods() = return g_; } - [CqlDeclaration("Max Long Term Care Period Length")] - public int? Max_Long_Term_Care_Period_Length() => - __Max_Long_Term_Care_Period_Length.Value; - - private IEnumerable Inpatient_Encounter_with_Advanced_Illness_Value() + [CqlDeclaration("Inpatient Encounter with Advanced Illness")] + public IEnumerable Inpatient_Encounter_with_Advanced_Illness(CqlContext context) { - var a_ = this.Acute_Inpatient(); + var a_ = this.Acute_Inpatient(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Encounter AcuteInpatient) { @@ -496,15 +355,15 @@ private IEnumerable Inpatient_Encounter_with_Advanced_Illness_Value() var d_ = context.Operators.WhereOrNull(b_, c_); IEnumerable e_(Encounter InpatientEncounter) { - var i_ = this.Advanced_Illness(); + var i_ = this.Advanced_Illness(context); var j_ = context.Operators.RetrieveByValueSet(i_, null); bool? k_(Condition AdvancedIllnessDiagnosis) { - var o_ = MATGlobalCommonFunctionsFHIR4_6_1_000.EncounterDiagnosis(InpatientEncounter); + var o_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.EncounterDiagnosis(context, InpatientEncounter); var p_ = context.Operators.InList(AdvancedIllnessDiagnosis, o_); - var q_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((InpatientEncounter?.Period as object)); + var q_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (InpatientEncounter?.Period as object)); var r_ = context.Operators.Start(q_); - var s_ = this.Measurement_Period(); + var s_ = this.Measurement_Period(context); var t_ = context.Operators.End(s_); var u_ = context.Operators.Quantity(2m, "years"); var v_ = context.Operators.Subtract(t_, u_); @@ -530,13 +389,10 @@ Encounter m_(Condition AdvancedIllnessDiagnosis) => return f_; } - [CqlDeclaration("Inpatient Encounter with Advanced Illness")] - public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => - __Inpatient_Encounter_with_Advanced_Illness.Value; - - private bool? Has_Criteria_Indicating_Frailty_Value() + [CqlDeclaration("Has Criteria Indicating Frailty")] + public bool? Has_Criteria_Indicating_Frailty(CqlContext context) { - var a_ = this.Frailty_Device(); + var a_ = this.Frailty_Device(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); var d_ = context.Operators.RetrieveByValueSet(a_, null); var e_ = context.Operators.ListUnion(b_, d_); @@ -553,8 +409,8 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => var aj_ = context.Operators.Convert(FrailtyDeviceOrder?.IntentElement); var ak_ = context.Operators.Equal(aj_, "order"); var al_ = context.Operators.And(ai_, ak_); - var am_ = this.Measurement_Period(); - var an_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((FrailtyDeviceOrder?.AuthoredOnElement as object)); + var am_ = this.Measurement_Period(context); + var an_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (FrailtyDeviceOrder?.AuthoredOnElement as object)); var ao_ = context.Operators.IntervalIncludesInterval(am_, an_, null); var ap_ = context.Operators.And(al_, ao_); @@ -573,8 +429,8 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => "corrected", }; var as_ = context.Operators.InList(aq_, (ar_ as IEnumerable)); - var at_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(FrailtyDeviceApplied?.Effective); - var au_ = this.Measurement_Period(); + var at_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, FrailtyDeviceApplied?.Effective); + var au_ = this.Measurement_Period(context); var av_ = context.Operators.Overlaps(at_, au_, null); var aw_ = context.Operators.And(as_, av_); @@ -583,12 +439,12 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => var l_ = context.Operators.WhereOrNull(j_, k_); var m_ = context.Operators.ExistsInList(l_); var n_ = context.Operators.Or(h_, m_); - var o_ = this.Frailty_Diagnosis(); + var o_ = this.Frailty_Diagnosis(context); var p_ = context.Operators.RetrieveByValueSet(o_, null); bool? q_(Condition FrailtyDiagnosis) { - var ax_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(FrailtyDiagnosis); - var ay_ = this.Measurement_Period(); + var ax_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, FrailtyDiagnosis); + var ay_ = this.Measurement_Period(context); var az_ = context.Operators.Overlaps(ax_, ay_, null); return az_; @@ -596,14 +452,14 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => var r_ = context.Operators.WhereOrNull(p_, q_); var s_ = context.Operators.ExistsInList(r_); var t_ = context.Operators.Or(n_, s_); - var u_ = this.Frailty_Encounter(); + var u_ = this.Frailty_Encounter(context); var v_ = context.Operators.RetrieveByValueSet(u_, null); bool? w_(Encounter FrailtyEncounter) { var ba_ = context.Operators.Convert(FrailtyEncounter?.StatusElement); var bb_ = context.Operators.Equal(ba_, "finished"); - var bc_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((FrailtyEncounter?.Period as object)); - var bd_ = this.Measurement_Period(); + var bc_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (FrailtyEncounter?.Period as object)); + var bd_ = this.Measurement_Period(context); var be_ = context.Operators.Overlaps(bc_, bd_, null); var bf_ = context.Operators.And(bb_, be_); @@ -612,7 +468,7 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => var x_ = context.Operators.WhereOrNull(v_, w_); var y_ = context.Operators.ExistsInList(x_); var z_ = context.Operators.Or(t_, y_); - var aa_ = this.Frailty_Symptom(); + var aa_ = this.Frailty_Symptom(context); var ab_ = context.Operators.RetrieveByValueSet(aa_, null); bool? ac_(Observation FrailtySymptom) { @@ -625,8 +481,8 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => "corrected", }; var bi_ = context.Operators.InList(bg_, (bh_ as IEnumerable)); - var bj_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(FrailtySymptom?.Effective); - var bk_ = this.Measurement_Period(); + var bj_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, FrailtySymptom?.Effective); + var bk_ = this.Measurement_Period(context); var bl_ = context.Operators.Overlaps(bj_, bk_, null); var bm_ = context.Operators.And(bi_, bl_); @@ -639,28 +495,25 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => return af_; } - [CqlDeclaration("Has Criteria Indicating Frailty")] - public bool? Has_Criteria_Indicating_Frailty() => - __Has_Criteria_Indicating_Frailty.Value; - - private bool? Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80_Value() + [CqlDeclaration("Advanced Illness and Frailty Exclusion Including Over Age 80")] + public bool? Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); var g_ = context.Operators.Interval((int?)65, (int?)79, true, true); var h_ = context.Operators.ElementInInterval(f_, g_, null); - var i_ = this.Has_Criteria_Indicating_Frailty(); + var i_ = this.Has_Criteria_Indicating_Frailty(context); var j_ = context.Operators.And(h_, i_); - var k_ = this.Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service(); + var k_ = this.Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service(context); var l_ = context.Operators.ExistsInList(k_); - var m_ = this.Inpatient_Encounter_with_Advanced_Illness(); + var m_ = this.Inpatient_Encounter_with_Advanced_Illness(context); var n_ = context.Operators.ExistsInList(m_); var o_ = context.Operators.Or(l_, n_); - var p_ = this.Dementia_Medications_In_Year_Before_or_During_Measurement_Period(); + var p_ = this.Dementia_Medications_In_Year_Before_or_During_Measurement_Period(context); var q_ = context.Operators.ExistsInList(p_); var r_ = context.Operators.Or(o_, q_); var s_ = context.Operators.And(j_, r_); @@ -675,27 +528,24 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => return ac_; } - [CqlDeclaration("Advanced Illness and Frailty Exclusion Including Over Age 80")] - public bool? Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80() => - __Advanced_Illness_and_Frailty_Exclusion_Including_Over_Age_80.Value; - - private bool? Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80_Value() + [CqlDeclaration("Advanced Illness and Frailty Exclusion Not Including Over Age 80")] + public bool? Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); var g_ = context.Operators.GreaterOrEqual(f_, (int?)65); - var h_ = this.Has_Criteria_Indicating_Frailty(); + var h_ = this.Has_Criteria_Indicating_Frailty(context); var i_ = context.Operators.And(g_, h_); - var j_ = this.Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service(); + var j_ = this.Two_Outpatient_Encounters_with_Advanced_Illness_on_Different_Dates_of_Service(context); var k_ = context.Operators.ExistsInList(j_); - var l_ = this.Inpatient_Encounter_with_Advanced_Illness(); + var l_ = this.Inpatient_Encounter_with_Advanced_Illness(context); var m_ = context.Operators.ExistsInList(l_); var n_ = context.Operators.Or(k_, m_); - var o_ = this.Dementia_Medications_In_Year_Before_or_During_Measurement_Period(); + var o_ = this.Dementia_Medications_In_Year_Before_or_During_Measurement_Period(context); var p_ = context.Operators.ExistsInList(o_); var q_ = context.Operators.Or(n_, p_); var r_ = context.Operators.And(i_, q_); @@ -703,20 +553,13 @@ public IEnumerable Inpatient_Encounter_with_Advanced_Illness() => return r_; } - [CqlDeclaration("Advanced Illness and Frailty Exclusion Not Including Over Age 80")] - public bool? Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80() => - __Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80.Value; - - private bool? Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days_Value() + [CqlDeclaration("Has Long Term Care Periods Longer Than 90 Consecutive Days")] + public bool? Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days(CqlContext context) { - var a_ = this.Max_Long_Term_Care_Period_Length(); + var a_ = this.Max_Long_Term_Care_Period_Length(context); var b_ = context.Operators.Greater(a_, (int?)90); return b_; } - [CqlDeclaration("Has Long Term Care Periods Longer Than 90 Consecutive Days")] - public bool? Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days() => - __Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days.Value; - } \ No newline at end of file diff --git a/Demo/Measures/BCSEHEDISMY2022-1.0.0.cs b/Demo/Measures/BCSEHEDISMY2022-1.0.0.cs index d6042b462..75215a97d 100644 --- a/Demo/Measures/BCSEHEDISMY2022-1.0.0.cs +++ b/Demo/Measures/BCSEHEDISMY2022-1.0.0.cs @@ -14,234 +14,93 @@ public class BCSEHEDISMY2022_1_0_0 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __Absence_of_Left_Breast; - internal Lazy __Absence_of_Right_Breast; - internal Lazy __Bilateral_Mastectomy; - internal Lazy __Bilateral_Modifier; - internal Lazy __Clinical_Bilateral_Modifier; - internal Lazy __Clinical_Left_Modifier; - internal Lazy __Clinical_Right_Modifier; - internal Lazy __Clinical_Unilateral_Mastectomy; - internal Lazy __History_of_Bilateral_Mastectomy; - internal Lazy __Left_Modifier; - internal Lazy __Mammography; - internal Lazy __Right_Modifier; - internal Lazy __Unilateral_Mastectomy; - internal Lazy __Unilateral_Mastectomy_Left; - internal Lazy __Unilateral_Mastectomy_Right; - internal Lazy> __Measurement_Period; - internal Lazy __Patient; - internal Lazy __October_1_Two_Years_Prior_to_the_Measurement_Period; - internal Lazy> __Participation_Period; - internal Lazy> __Member_Coverage; - internal Lazy __Enrolled_During_Participation_Period; - internal Lazy __Initial_Population; - internal Lazy __Denominator; - internal Lazy> __Right_Mastectomy_Diagnosis; - internal Lazy> __Right_Mastectomy_Procedure; - internal Lazy> __Left_Mastectomy_Diagnosis; - internal Lazy> __Left_Mastectomy_Procedure; - internal Lazy> __Bilateral_Mastectomy_Diagnosis; - internal Lazy> __Bilateral_Mastectomy_Procedure; - internal Lazy __Mastectomy_Exclusion; - internal Lazy __Exclusions; - internal Lazy __Numerator; - - #endregion - public BCSEHEDISMY2022_1_0_0(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - NCQAHealthPlanEnrollment_1_0_0 = new NCQAHealthPlanEnrollment_1_0_0(context); - NCQAStatus_1_0_0 = new NCQAStatus_1_0_0(context); - NCQAFHIRBase_1_0_0 = new NCQAFHIRBase_1_0_0(context); - NCQAHospice_1_0_0 = new NCQAHospice_1_0_0(context); - NCQAAdvancedIllnessandFrailty_1_0_0 = new NCQAAdvancedIllnessandFrailty_1_0_0(context); - NCQAPalliativeCare_1_0_0 = new NCQAPalliativeCare_1_0_0(context); - - __Absence_of_Left_Breast = new Lazy(this.Absence_of_Left_Breast_Value); - __Absence_of_Right_Breast = new Lazy(this.Absence_of_Right_Breast_Value); - __Bilateral_Mastectomy = new Lazy(this.Bilateral_Mastectomy_Value); - __Bilateral_Modifier = new Lazy(this.Bilateral_Modifier_Value); - __Clinical_Bilateral_Modifier = new Lazy(this.Clinical_Bilateral_Modifier_Value); - __Clinical_Left_Modifier = new Lazy(this.Clinical_Left_Modifier_Value); - __Clinical_Right_Modifier = new Lazy(this.Clinical_Right_Modifier_Value); - __Clinical_Unilateral_Mastectomy = new Lazy(this.Clinical_Unilateral_Mastectomy_Value); - __History_of_Bilateral_Mastectomy = new Lazy(this.History_of_Bilateral_Mastectomy_Value); - __Left_Modifier = new Lazy(this.Left_Modifier_Value); - __Mammography = new Lazy(this.Mammography_Value); - __Right_Modifier = new Lazy(this.Right_Modifier_Value); - __Unilateral_Mastectomy = new Lazy(this.Unilateral_Mastectomy_Value); - __Unilateral_Mastectomy_Left = new Lazy(this.Unilateral_Mastectomy_Left_Value); - __Unilateral_Mastectomy_Right = new Lazy(this.Unilateral_Mastectomy_Right_Value); - __Measurement_Period = new Lazy>(this.Measurement_Period_Value); - __Patient = new Lazy(this.Patient_Value); - __October_1_Two_Years_Prior_to_the_Measurement_Period = new Lazy(this.October_1_Two_Years_Prior_to_the_Measurement_Period_Value); - __Participation_Period = new Lazy>(this.Participation_Period_Value); - __Member_Coverage = new Lazy>(this.Member_Coverage_Value); - __Enrolled_During_Participation_Period = new Lazy(this.Enrolled_During_Participation_Period_Value); - __Initial_Population = new Lazy(this.Initial_Population_Value); - __Denominator = new Lazy(this.Denominator_Value); - __Right_Mastectomy_Diagnosis = new Lazy>(this.Right_Mastectomy_Diagnosis_Value); - __Right_Mastectomy_Procedure = new Lazy>(this.Right_Mastectomy_Procedure_Value); - __Left_Mastectomy_Diagnosis = new Lazy>(this.Left_Mastectomy_Diagnosis_Value); - __Left_Mastectomy_Procedure = new Lazy>(this.Left_Mastectomy_Procedure_Value); - __Bilateral_Mastectomy_Diagnosis = new Lazy>(this.Bilateral_Mastectomy_Diagnosis_Value); - __Bilateral_Mastectomy_Procedure = new Lazy>(this.Bilateral_Mastectomy_Procedure_Value); - __Mastectomy_Exclusion = new Lazy(this.Mastectomy_Exclusion_Value); - __Exclusions = new Lazy(this.Exclusions_Value); - __Numerator = new Lazy(this.Numerator_Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - public NCQAHealthPlanEnrollment_1_0_0 NCQAHealthPlanEnrollment_1_0_0 { get; } - public NCQAStatus_1_0_0 NCQAStatus_1_0_0 { get; } - public NCQAFHIRBase_1_0_0 NCQAFHIRBase_1_0_0 { get; } - public NCQAHospice_1_0_0 NCQAHospice_1_0_0 { get; } - public NCQAAdvancedIllnessandFrailty_1_0_0 NCQAAdvancedIllnessandFrailty_1_0_0 { get; } - public NCQAPalliativeCare_1_0_0 NCQAPalliativeCare_1_0_0 { get; } - - #endregion - - private CqlValueSet Absence_of_Left_Breast_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1329", null); + public static BCSEHEDISMY2022_1_0_0 Instance { get; } = new(); [CqlDeclaration("Absence of Left Breast")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1329")] - public CqlValueSet Absence_of_Left_Breast() => - __Absence_of_Left_Breast.Value; - - private CqlValueSet Absence_of_Right_Breast_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1330", null); + public CqlValueSet Absence_of_Left_Breast(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1329", null); [CqlDeclaration("Absence of Right Breast")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1330")] - public CqlValueSet Absence_of_Right_Breast() => - __Absence_of_Right_Breast.Value; - - private CqlValueSet Bilateral_Mastectomy_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1042", null); + public CqlValueSet Absence_of_Right_Breast(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1330", null); [CqlDeclaration("Bilateral Mastectomy")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1042")] - public CqlValueSet Bilateral_Mastectomy() => - __Bilateral_Mastectomy.Value; - - private CqlValueSet Bilateral_Modifier_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1043", null); + public CqlValueSet Bilateral_Mastectomy(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1042", null); [CqlDeclaration("Bilateral Modifier")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1043")] - public CqlValueSet Bilateral_Modifier() => - __Bilateral_Modifier.Value; - - private CqlValueSet Clinical_Bilateral_Modifier_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1951", null); + public CqlValueSet Bilateral_Modifier(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1043", null); [CqlDeclaration("Clinical Bilateral Modifier")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1951")] - public CqlValueSet Clinical_Bilateral_Modifier() => - __Clinical_Bilateral_Modifier.Value; - - private CqlValueSet Clinical_Left_Modifier_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1949", null); + public CqlValueSet Clinical_Bilateral_Modifier(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1951", null); [CqlDeclaration("Clinical Left Modifier")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1949")] - public CqlValueSet Clinical_Left_Modifier() => - __Clinical_Left_Modifier.Value; - - private CqlValueSet Clinical_Right_Modifier_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1950", null); + public CqlValueSet Clinical_Left_Modifier(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1949", null); [CqlDeclaration("Clinical Right Modifier")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1950")] - public CqlValueSet Clinical_Right_Modifier() => - __Clinical_Right_Modifier.Value; - - private CqlValueSet Clinical_Unilateral_Mastectomy_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1948", null); + public CqlValueSet Clinical_Right_Modifier(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1950", null); [CqlDeclaration("Clinical Unilateral Mastectomy")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1948")] - public CqlValueSet Clinical_Unilateral_Mastectomy() => - __Clinical_Unilateral_Mastectomy.Value; - - private CqlValueSet History_of_Bilateral_Mastectomy_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1331", null); + public CqlValueSet Clinical_Unilateral_Mastectomy(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1948", null); [CqlDeclaration("History of Bilateral Mastectomy")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1331")] - public CqlValueSet History_of_Bilateral_Mastectomy() => - __History_of_Bilateral_Mastectomy.Value; - - private CqlValueSet Left_Modifier_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1148", null); + public CqlValueSet History_of_Bilateral_Mastectomy(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1331", null); [CqlDeclaration("Left Modifier")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1148")] - public CqlValueSet Left_Modifier() => - __Left_Modifier.Value; - - private CqlValueSet Mammography_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1168", null); + public CqlValueSet Left_Modifier(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1148", null); [CqlDeclaration("Mammography")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1168")] - public CqlValueSet Mammography() => - __Mammography.Value; - - private CqlValueSet Right_Modifier_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1230", null); + public CqlValueSet Mammography(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1168", null); [CqlDeclaration("Right Modifier")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1230")] - public CqlValueSet Right_Modifier() => - __Right_Modifier.Value; - - private CqlValueSet Unilateral_Mastectomy_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1256", null); + public CqlValueSet Right_Modifier(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1230", null); [CqlDeclaration("Unilateral Mastectomy")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1256")] - public CqlValueSet Unilateral_Mastectomy() => - __Unilateral_Mastectomy.Value; - - private CqlValueSet Unilateral_Mastectomy_Left_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1334", null); + public CqlValueSet Unilateral_Mastectomy(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1256", null); [CqlDeclaration("Unilateral Mastectomy Left")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1334")] - public CqlValueSet Unilateral_Mastectomy_Left() => - __Unilateral_Mastectomy_Left.Value; - - private CqlValueSet Unilateral_Mastectomy_Right_Value() => - new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1335", null); + public CqlValueSet Unilateral_Mastectomy_Left(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1334", null); [CqlDeclaration("Unilateral Mastectomy Right")] [CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1335")] - public CqlValueSet Unilateral_Mastectomy_Right() => - __Unilateral_Mastectomy_Right.Value; + public CqlValueSet Unilateral_Mastectomy_Right(CqlContext context) => + new CqlValueSet("https://www.ncqa.org/fhir/valueset/2.16.840.1.113883.3.464.1004.1335", null); - private CqlInterval Measurement_Period_Value() + [CqlDeclaration("Measurement Period")] + public CqlInterval Measurement_Period(CqlContext context) { var a_ = context.ResolveParameter("BCSEHEDISMY2022-1.0.0", "Measurement Period", null); return (CqlInterval)a_; } - [CqlDeclaration("Measurement Period")] - public CqlInterval Measurement_Period() => - __Measurement_Period.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -249,13 +108,10 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - - private CqlDateTime October_1_Two_Years_Prior_to_the_Measurement_Period_Value() + [CqlDeclaration("October 1 Two Years Prior to the Measurement Period")] + public CqlDateTime October_1_Two_Years_Prior_to_the_Measurement_Period(CqlContext context) { - var a_ = this.Measurement_Period(); + var a_ = this.Measurement_Period(context); var b_ = context.Operators.Start(a_); var c_ = context.Operators.ComponentFrom(b_, "year"); var d_ = context.Operators.Subtract(c_, (int?)2); @@ -265,31 +121,25 @@ private CqlDateTime October_1_Two_Years_Prior_to_the_Measurement_Period_Value() return f_; } - [CqlDeclaration("October 1 Two Years Prior to the Measurement Period")] - public CqlDateTime October_1_Two_Years_Prior_to_the_Measurement_Period() => - __October_1_Two_Years_Prior_to_the_Measurement_Period.Value; - - private CqlInterval Participation_Period_Value() + [CqlDeclaration("Participation Period")] + public CqlInterval Participation_Period(CqlContext context) { - var a_ = this.October_1_Two_Years_Prior_to_the_Measurement_Period(); - var b_ = this.Measurement_Period(); + var a_ = this.October_1_Two_Years_Prior_to_the_Measurement_Period(context); + var b_ = this.Measurement_Period(context); var c_ = context.Operators.End(b_); var d_ = context.Operators.Interval(a_, c_, true, true); return d_; } - [CqlDeclaration("Participation Period")] - public CqlInterval Participation_Period() => - __Participation_Period.Value; - - private IEnumerable Member_Coverage_Value() + [CqlDeclaration("Member Coverage")] + public IEnumerable Member_Coverage(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); bool? b_(Coverage C) { - var d_ = NCQAFHIRBase_1_0_0.Normalize_Interval((C?.Period as object)); - var e_ = this.Participation_Period(); + var d_ = NCQAFHIRBase_1_0_0.Instance.Normalize_Interval(context, (C?.Period as object)); + var e_ = this.Participation_Period(context); var f_ = context.Operators.Overlaps(d_, e_, null); return f_; @@ -299,24 +149,21 @@ private IEnumerable Member_Coverage_Value() return c_; } - [CqlDeclaration("Member Coverage")] - public IEnumerable Member_Coverage() => - __Member_Coverage.Value; - - private bool? Enrolled_During_Participation_Period_Value() + [CqlDeclaration("Enrolled During Participation Period")] + public bool? Enrolled_During_Participation_Period(CqlContext context) { - var a_ = this.Member_Coverage(); - var b_ = this.Measurement_Period(); + var a_ = this.Member_Coverage(context); + var b_ = this.Measurement_Period(context); var c_ = context.Operators.End(b_); var d_ = context.Operators.DateFrom(c_); - var e_ = this.October_1_Two_Years_Prior_to_the_Measurement_Period(); + var e_ = this.October_1_Two_Years_Prior_to_the_Measurement_Period(context); var f_ = context.Operators.DateFrom(e_); var h_ = context.Operators.End(b_); var i_ = context.Operators.DateFrom(h_); var j_ = context.Operators.Quantity(2m, "years"); var k_ = context.Operators.Subtract(i_, j_); var l_ = context.Operators.Interval(f_, k_, true, true); - var m_ = NCQAHealthPlanEnrollment_1_0_0.Health_Plan_Enrollment_Criteria(a_, d_, l_, (int?)0); + var m_ = NCQAHealthPlanEnrollment_1_0_0.Instance.Health_Plan_Enrollment_Criteria(context, a_, d_, l_, (int?)0); var p_ = context.Operators.End(b_); var q_ = context.Operators.DateFrom(p_); var s_ = context.Operators.Start(b_); @@ -327,7 +174,7 @@ public IEnumerable Member_Coverage() => var y_ = context.Operators.DateFrom(x_); var aa_ = context.Operators.Subtract(y_, u_); var ab_ = context.Operators.Interval(v_, aa_, true, true); - var ac_ = NCQAHealthPlanEnrollment_1_0_0.Health_Plan_Enrollment_Criteria(a_, q_, ab_, (int?)45); + var ac_ = NCQAHealthPlanEnrollment_1_0_0.Instance.Health_Plan_Enrollment_Criteria(context, a_, q_, ab_, (int?)45); var ad_ = context.Operators.And(m_, ac_); var ag_ = context.Operators.End(b_); var ah_ = context.Operators.DateFrom(ag_); @@ -336,21 +183,18 @@ public IEnumerable Member_Coverage() => var am_ = context.Operators.End(b_); var an_ = context.Operators.DateFrom(am_); var ao_ = context.Operators.Interval(ak_, an_, true, true); - var ap_ = NCQAHealthPlanEnrollment_1_0_0.Health_Plan_Enrollment_Criteria(a_, ah_, ao_, (int?)45); + var ap_ = NCQAHealthPlanEnrollment_1_0_0.Instance.Health_Plan_Enrollment_Criteria(context, a_, ah_, ao_, (int?)45); var aq_ = context.Operators.And(ad_, ap_); return aq_; } - [CqlDeclaration("Enrolled During Participation Period")] - public bool? Enrolled_During_Participation_Period() => - __Enrolled_During_Participation_Period.Value; - - private bool? Initial_Population_Value() + [CqlDeclaration("Initial Population")] + public bool? Initial_Population(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.End(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); @@ -358,37 +202,31 @@ public IEnumerable Member_Coverage() => var h_ = context.Operators.ElementInInterval(f_, g_, null); var j_ = context.Operators.EnumEqualsString(a_?.GenderElement?.Value, "female"); var k_ = context.Operators.And(h_, j_); - var l_ = this.Enrolled_During_Participation_Period(); + var l_ = this.Enrolled_During_Participation_Period(context); var m_ = context.Operators.And(k_, l_); return m_; } - [CqlDeclaration("Initial Population")] - public bool? Initial_Population() => - __Initial_Population.Value; - - private bool? Denominator_Value() + [CqlDeclaration("Denominator")] + public bool? Denominator(CqlContext context) { - var a_ = this.Initial_Population(); + var a_ = this.Initial_Population(context); return a_; } - [CqlDeclaration("Denominator")] - public bool? Denominator() => - __Denominator.Value; - - private IEnumerable Right_Mastectomy_Diagnosis_Value() + [CqlDeclaration("Right Mastectomy Diagnosis")] + public IEnumerable Right_Mastectomy_Diagnosis(CqlContext context) { - var a_ = this.Absence_of_Right_Breast(); + var a_ = this.Absence_of_Right_Breast(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = NCQAStatus_1_0_0.Active_Condition(b_); + var c_ = NCQAStatus_1_0_0.Instance.Active_Condition(context, b_); bool? d_(Condition RightMastectomyDiagnosis) { - var f_ = NCQAFHIRBase_1_0_0.Prevalence_Period(RightMastectomyDiagnosis); + var f_ = NCQAFHIRBase_1_0_0.Instance.Prevalence_Period(context, RightMastectomyDiagnosis); var g_ = context.Operators.Start(f_); - var h_ = this.Measurement_Period(); + var h_ = this.Measurement_Period(context); var i_ = context.Operators.End(h_); var j_ = context.Operators.SameOrBefore(g_, i_, null); @@ -399,47 +237,44 @@ private IEnumerable Right_Mastectomy_Diagnosis_Value() return e_; } - [CqlDeclaration("Right Mastectomy Diagnosis")] - public IEnumerable Right_Mastectomy_Diagnosis() => - __Right_Mastectomy_Diagnosis.Value; - - private IEnumerable Right_Mastectomy_Procedure_Value() + [CqlDeclaration("Right Mastectomy Procedure")] + public IEnumerable Right_Mastectomy_Procedure(CqlContext context) { - var a_ = this.Unilateral_Mastectomy_Right(); + var a_ = this.Unilateral_Mastectomy_Right(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = NCQAStatus_1_0_0.Completed_Procedure(b_); - var d_ = this.Unilateral_Mastectomy(); + var c_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, b_); + var d_ = this.Unilateral_Mastectomy(context); var e_ = context.Operators.RetrieveByValueSet(d_, null); - var f_ = NCQAStatus_1_0_0.Completed_Procedure(e_); + var f_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, e_); bool? g_(Procedure UnilateralMastectomyProcedure) { CqlConcept r_(CodeableConcept X) { - var v_ = FHIRHelpers_4_0_001.ToConcept(X); + var v_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return v_; }; var s_ = context.Operators.SelectOrNull((UnilateralMastectomyProcedure?.BodySite as IEnumerable), r_); - var t_ = this.Right_Modifier(); + var t_ = this.Right_Modifier(context); var u_ = context.Operators.ConceptsInValueSet(s_, t_); return u_; }; var h_ = context.Operators.WhereOrNull(f_, g_); var i_ = context.Operators.ListUnion(c_, h_); - var j_ = this.Clinical_Unilateral_Mastectomy(); + var j_ = this.Clinical_Unilateral_Mastectomy(context); var k_ = context.Operators.RetrieveByValueSet(j_, null); - var l_ = NCQAStatus_1_0_0.Completed_Procedure(k_); + var l_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, k_); bool? m_(Procedure ClinicalUnilateralMastectomyProcedure) { CqlConcept w_(CodeableConcept X) { - var aa_ = FHIRHelpers_4_0_001.ToConcept(X); + var aa_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return aa_; }; var x_ = context.Operators.SelectOrNull((ClinicalUnilateralMastectomyProcedure?.BodySite as IEnumerable), w_); - var y_ = this.Clinical_Right_Modifier(); + var y_ = this.Clinical_Right_Modifier(context); var z_ = context.Operators.ConceptsInValueSet(x_, y_); return z_; @@ -448,9 +283,9 @@ CqlConcept w_(CodeableConcept X) var o_ = context.Operators.ListUnion(i_, n_); bool? p_(Procedure RightMastectomyProcedure) { - var ab_ = NCQAFHIRBase_1_0_0.Normalize_Interval(RightMastectomyProcedure?.Performed); + var ab_ = NCQAFHIRBase_1_0_0.Instance.Normalize_Interval(context, RightMastectomyProcedure?.Performed); var ac_ = context.Operators.End(ab_); - var ad_ = this.Measurement_Period(); + var ad_ = this.Measurement_Period(context); var ae_ = context.Operators.End(ad_); var af_ = context.Operators.SameOrBefore(ac_, ae_, null); @@ -461,20 +296,17 @@ CqlConcept w_(CodeableConcept X) return q_; } - [CqlDeclaration("Right Mastectomy Procedure")] - public IEnumerable Right_Mastectomy_Procedure() => - __Right_Mastectomy_Procedure.Value; - - private IEnumerable Left_Mastectomy_Diagnosis_Value() + [CqlDeclaration("Left Mastectomy Diagnosis")] + public IEnumerable Left_Mastectomy_Diagnosis(CqlContext context) { - var a_ = this.Absence_of_Left_Breast(); + var a_ = this.Absence_of_Left_Breast(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = NCQAStatus_1_0_0.Active_Condition(b_); + var c_ = NCQAStatus_1_0_0.Instance.Active_Condition(context, b_); bool? d_(Condition LeftMastectomyDiagnosis) { - var f_ = NCQAFHIRBase_1_0_0.Prevalence_Period(LeftMastectomyDiagnosis); + var f_ = NCQAFHIRBase_1_0_0.Instance.Prevalence_Period(context, LeftMastectomyDiagnosis); var g_ = context.Operators.Start(f_); - var h_ = this.Measurement_Period(); + var h_ = this.Measurement_Period(context); var i_ = context.Operators.End(h_); var j_ = context.Operators.SameOrBefore(g_, i_, null); @@ -485,47 +317,44 @@ private IEnumerable Left_Mastectomy_Diagnosis_Value() return e_; } - [CqlDeclaration("Left Mastectomy Diagnosis")] - public IEnumerable Left_Mastectomy_Diagnosis() => - __Left_Mastectomy_Diagnosis.Value; - - private IEnumerable Left_Mastectomy_Procedure_Value() + [CqlDeclaration("Left Mastectomy Procedure")] + public IEnumerable Left_Mastectomy_Procedure(CqlContext context) { - var a_ = this.Unilateral_Mastectomy_Left(); + var a_ = this.Unilateral_Mastectomy_Left(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = NCQAStatus_1_0_0.Completed_Procedure(b_); - var d_ = this.Unilateral_Mastectomy(); + var c_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, b_); + var d_ = this.Unilateral_Mastectomy(context); var e_ = context.Operators.RetrieveByValueSet(d_, null); - var f_ = NCQAStatus_1_0_0.Completed_Procedure(e_); + var f_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, e_); bool? g_(Procedure UnilateralMastectomyProcedure) { CqlConcept r_(CodeableConcept X) { - var v_ = FHIRHelpers_4_0_001.ToConcept(X); + var v_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return v_; }; var s_ = context.Operators.SelectOrNull((UnilateralMastectomyProcedure?.BodySite as IEnumerable), r_); - var t_ = this.Left_Modifier(); + var t_ = this.Left_Modifier(context); var u_ = context.Operators.ConceptsInValueSet(s_, t_); return u_; }; var h_ = context.Operators.WhereOrNull(f_, g_); var i_ = context.Operators.ListUnion(c_, h_); - var j_ = this.Clinical_Unilateral_Mastectomy(); + var j_ = this.Clinical_Unilateral_Mastectomy(context); var k_ = context.Operators.RetrieveByValueSet(j_, null); - var l_ = NCQAStatus_1_0_0.Completed_Procedure(k_); + var l_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, k_); bool? m_(Procedure ClinicalUnilateralMastectomyProcedure) { CqlConcept w_(CodeableConcept X) { - var aa_ = FHIRHelpers_4_0_001.ToConcept(X); + var aa_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return aa_; }; var x_ = context.Operators.SelectOrNull((ClinicalUnilateralMastectomyProcedure?.BodySite as IEnumerable), w_); - var y_ = this.Clinical_Left_Modifier(); + var y_ = this.Clinical_Left_Modifier(context); var z_ = context.Operators.ConceptsInValueSet(x_, y_); return z_; @@ -534,9 +363,9 @@ CqlConcept w_(CodeableConcept X) var o_ = context.Operators.ListUnion(i_, n_); bool? p_(Procedure LeftMastectomyProcedure) { - var ab_ = NCQAFHIRBase_1_0_0.Normalize_Interval(LeftMastectomyProcedure?.Performed); + var ab_ = NCQAFHIRBase_1_0_0.Instance.Normalize_Interval(context, LeftMastectomyProcedure?.Performed); var ac_ = context.Operators.End(ab_); - var ad_ = this.Measurement_Period(); + var ad_ = this.Measurement_Period(context); var ae_ = context.Operators.End(ad_); var af_ = context.Operators.SameOrBefore(ac_, ae_, null); @@ -547,20 +376,17 @@ CqlConcept w_(CodeableConcept X) return q_; } - [CqlDeclaration("Left Mastectomy Procedure")] - public IEnumerable Left_Mastectomy_Procedure() => - __Left_Mastectomy_Procedure.Value; - - private IEnumerable Bilateral_Mastectomy_Diagnosis_Value() + [CqlDeclaration("Bilateral Mastectomy Diagnosis")] + public IEnumerable Bilateral_Mastectomy_Diagnosis(CqlContext context) { - var a_ = this.History_of_Bilateral_Mastectomy(); + var a_ = this.History_of_Bilateral_Mastectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = NCQAStatus_1_0_0.Active_Condition(b_); + var c_ = NCQAStatus_1_0_0.Instance.Active_Condition(context, b_); bool? d_(Condition BilateralMastectomyHistory) { - var f_ = NCQAFHIRBase_1_0_0.Prevalence_Period(BilateralMastectomyHistory); + var f_ = NCQAFHIRBase_1_0_0.Instance.Prevalence_Period(context, BilateralMastectomyHistory); var g_ = context.Operators.Start(f_); - var h_ = this.Measurement_Period(); + var h_ = this.Measurement_Period(context); var i_ = context.Operators.End(h_); var j_ = context.Operators.SameOrBefore(g_, i_, null); @@ -571,47 +397,44 @@ private IEnumerable Bilateral_Mastectomy_Diagnosis_Value() return e_; } - [CqlDeclaration("Bilateral Mastectomy Diagnosis")] - public IEnumerable Bilateral_Mastectomy_Diagnosis() => - __Bilateral_Mastectomy_Diagnosis.Value; - - private IEnumerable Bilateral_Mastectomy_Procedure_Value() + [CqlDeclaration("Bilateral Mastectomy Procedure")] + public IEnumerable Bilateral_Mastectomy_Procedure(CqlContext context) { - var a_ = this.Bilateral_Mastectomy(); + var a_ = this.Bilateral_Mastectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = NCQAStatus_1_0_0.Completed_Procedure(b_); - var d_ = this.Unilateral_Mastectomy(); + var c_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, b_); + var d_ = this.Unilateral_Mastectomy(context); var e_ = context.Operators.RetrieveByValueSet(d_, null); - var f_ = NCQAStatus_1_0_0.Completed_Procedure(e_); + var f_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, e_); bool? g_(Procedure UnilateralMastectomyProcedure) { CqlConcept r_(CodeableConcept X) { - var v_ = FHIRHelpers_4_0_001.ToConcept(X); + var v_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return v_; }; var s_ = context.Operators.SelectOrNull((UnilateralMastectomyProcedure?.BodySite as IEnumerable), r_); - var t_ = this.Bilateral_Modifier(); + var t_ = this.Bilateral_Modifier(context); var u_ = context.Operators.ConceptsInValueSet(s_, t_); return u_; }; var h_ = context.Operators.WhereOrNull(f_, g_); var i_ = context.Operators.ListUnion(c_, h_); - var j_ = this.Clinical_Unilateral_Mastectomy(); + var j_ = this.Clinical_Unilateral_Mastectomy(context); var k_ = context.Operators.RetrieveByValueSet(j_, null); - var l_ = NCQAStatus_1_0_0.Completed_Procedure(k_); + var l_ = NCQAStatus_1_0_0.Instance.Completed_Procedure(context, k_); bool? m_(Procedure ClinicalUnilateralMastectomyProcedure) { CqlConcept w_(CodeableConcept X) { - var aa_ = FHIRHelpers_4_0_001.ToConcept(X); + var aa_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return aa_; }; var x_ = context.Operators.SelectOrNull((ClinicalUnilateralMastectomyProcedure?.BodySite as IEnumerable), w_); - var y_ = this.Clinical_Bilateral_Modifier(); + var y_ = this.Clinical_Bilateral_Modifier(context); var z_ = context.Operators.ConceptsInValueSet(x_, y_); return z_; @@ -620,9 +443,9 @@ CqlConcept w_(CodeableConcept X) var o_ = context.Operators.ListUnion(i_, n_); bool? p_(Procedure BilateralMastectomyPerformed) { - var ab_ = NCQAFHIRBase_1_0_0.Normalize_Interval(BilateralMastectomyPerformed?.Performed); + var ab_ = NCQAFHIRBase_1_0_0.Instance.Normalize_Interval(context, BilateralMastectomyPerformed?.Performed); var ac_ = context.Operators.End(ab_); - var ad_ = this.Measurement_Period(); + var ad_ = this.Measurement_Period(context); var ae_ = context.Operators.End(ad_); var af_ = context.Operators.SameOrBefore(ac_, ae_, null); @@ -633,64 +456,55 @@ CqlConcept w_(CodeableConcept X) return q_; } - [CqlDeclaration("Bilateral Mastectomy Procedure")] - public IEnumerable Bilateral_Mastectomy_Procedure() => - __Bilateral_Mastectomy_Procedure.Value; - - private bool? Mastectomy_Exclusion_Value() + [CqlDeclaration("Mastectomy Exclusion")] + public bool? Mastectomy_Exclusion(CqlContext context) { - var a_ = this.Right_Mastectomy_Diagnosis(); + var a_ = this.Right_Mastectomy_Diagnosis(context); var b_ = context.Operators.ExistsInList(a_); - var c_ = this.Right_Mastectomy_Procedure(); + var c_ = this.Right_Mastectomy_Procedure(context); var d_ = context.Operators.ExistsInList(c_); var e_ = context.Operators.Or(b_, d_); - var f_ = this.Left_Mastectomy_Diagnosis(); + var f_ = this.Left_Mastectomy_Diagnosis(context); var g_ = context.Operators.ExistsInList(f_); - var h_ = this.Left_Mastectomy_Procedure(); + var h_ = this.Left_Mastectomy_Procedure(context); var i_ = context.Operators.ExistsInList(h_); var j_ = context.Operators.Or(g_, i_); var k_ = context.Operators.And(e_, j_); - var l_ = this.Bilateral_Mastectomy_Diagnosis(); + var l_ = this.Bilateral_Mastectomy_Diagnosis(context); var m_ = context.Operators.ExistsInList(l_); var n_ = context.Operators.Or(k_, m_); - var o_ = this.Bilateral_Mastectomy_Procedure(); + var o_ = this.Bilateral_Mastectomy_Procedure(context); var p_ = context.Operators.ExistsInList(o_); var q_ = context.Operators.Or(n_, p_); return q_; } - [CqlDeclaration("Mastectomy Exclusion")] - public bool? Mastectomy_Exclusion() => - __Mastectomy_Exclusion.Value; - - private bool? Exclusions_Value() + [CqlDeclaration("Exclusions")] + public bool? Exclusions(CqlContext context) { - var a_ = NCQAHospice_1_0_0.Hospice_Intervention_or_Encounter(); - var b_ = this.Mastectomy_Exclusion(); + var a_ = NCQAHospice_1_0_0.Instance.Hospice_Intervention_or_Encounter(context); + var b_ = this.Mastectomy_Exclusion(context); var c_ = context.Operators.Or(a_, b_); - var d_ = NCQAAdvancedIllnessandFrailty_1_0_0.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(); + var d_ = NCQAAdvancedIllnessandFrailty_1_0_0.Instance.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(context); var e_ = context.Operators.Or(c_, d_); - var f_ = this.Measurement_Period(); - var g_ = NCQAPalliativeCare_1_0_0.Palliative_Care_Overlapping_Period(f_); + var f_ = this.Measurement_Period(context); + var g_ = NCQAPalliativeCare_1_0_0.Instance.Palliative_Care_Overlapping_Period(context, f_); var h_ = context.Operators.Or(e_, g_); return h_; } - [CqlDeclaration("Exclusions")] - public bool? Exclusions() => - __Exclusions.Value; - - private bool? Numerator_Value() + [CqlDeclaration("Numerator")] + public bool? Numerator(CqlContext context) { - var a_ = this.Mammography(); + var a_ = this.Mammography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation Mammogram) { - var f_ = NCQAFHIRBase_1_0_0.Normalize_Interval(Mammogram?.Effective); + var f_ = NCQAFHIRBase_1_0_0.Instance.Normalize_Interval(context, Mammogram?.Effective); var g_ = context.Operators.End(f_); - var h_ = this.Participation_Period(); + var h_ = this.Participation_Period(context); var i_ = context.Operators.ElementInInterval(g_, h_, null); return i_; @@ -701,8 +515,4 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => return e_; } - [CqlDeclaration("Numerator")] - public bool? Numerator() => - __Numerator.Value; - } \ No newline at end of file diff --git a/Demo/Measures/BreastCancerScreeningsFHIR-0.0.009.cs b/Demo/Measures/BreastCancerScreeningsFHIR-0.0.009.cs index 54b21bc80..4158f7451 100644 --- a/Demo/Measures/BreastCancerScreeningsFHIR-0.0.009.cs +++ b/Demo/Measures/BreastCancerScreeningsFHIR-0.0.009.cs @@ -14,207 +14,70 @@ public class BreastCancerScreeningsFHIR_0_0_009 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __Bilateral_Mastectomy; - internal Lazy __History_of_bilateral_mastectomy; - internal Lazy __Left; - internal Lazy __Mammography; - internal Lazy __Online_Assessments; - internal Lazy __Right; - internal Lazy __Status_Post_Left_Mastectomy; - internal Lazy __Status_Post_Right_Mastectomy; - internal Lazy __Telephone_Visits; - internal Lazy __Unilateral_Mastectomy_Left; - internal Lazy __Unilateral_Mastectomy_Right; - internal Lazy __Unilateral_Mastectomy__Unspecified_Laterality; - internal Lazy> __Measurement_Period; - internal Lazy __Patient; - internal Lazy> __SDE_Ethnicity; - internal Lazy> __SDE_Payer; - internal Lazy> __SDE_Race; - internal Lazy __SDE_Sex; - internal Lazy> __Telehealth_Services; - internal Lazy __Age_at_start_of_Measurement_Period; - internal Lazy __Initial_Population; - internal Lazy __Denominator; - internal Lazy> __Right_Mastectomy_Diagnosis; - internal Lazy> __Right_Mastectomy_Procedure; - internal Lazy> __Left_Mastectomy_Diagnosis; - internal Lazy> __Left_Mastectomy_Procedure; - internal Lazy> __Bilateral_Mastectomy_Diagnosis; - internal Lazy> __Bilateral_Mastectomy_Procedure; - internal Lazy __Denominator_Exclusions; - internal Lazy __Observation_with_status; - internal Lazy __Diagnostic_Report_with_status; - internal Lazy __Numerator; - internal Lazy __Final_Numerator_Population; - internal Lazy __Observation_without_appropriate_status; - internal Lazy __Diagnostic_Report_without_appropriate_status; - - #endregion - public BreastCancerScreeningsFHIR_0_0_009(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - SupplementalDataElementsFHIR4_2_0_000 = new SupplementalDataElementsFHIR4_2_0_000(context); - MATGlobalCommonFunctionsFHIR4_6_1_000 = new MATGlobalCommonFunctionsFHIR4_6_1_000(context); - AdultOutpatientEncountersFHIR4_2_2_000 = new AdultOutpatientEncountersFHIR4_2_2_000(context); - AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 = new AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000(context); - PalliativeCareFHIR_0_6_000 = new PalliativeCareFHIR_0_6_000(context); - CumulativeMedicationDurationFHIR4_1_0_000 = new CumulativeMedicationDurationFHIR4_1_0_000(context); - HospiceFHIR4_2_3_000 = new HospiceFHIR4_2_3_000(context); - - __Bilateral_Mastectomy = new Lazy(this.Bilateral_Mastectomy_Value); - __History_of_bilateral_mastectomy = new Lazy(this.History_of_bilateral_mastectomy_Value); - __Left = new Lazy(this.Left_Value); - __Mammography = new Lazy(this.Mammography_Value); - __Online_Assessments = new Lazy(this.Online_Assessments_Value); - __Right = new Lazy(this.Right_Value); - __Status_Post_Left_Mastectomy = new Lazy(this.Status_Post_Left_Mastectomy_Value); - __Status_Post_Right_Mastectomy = new Lazy(this.Status_Post_Right_Mastectomy_Value); - __Telephone_Visits = new Lazy(this.Telephone_Visits_Value); - __Unilateral_Mastectomy_Left = new Lazy(this.Unilateral_Mastectomy_Left_Value); - __Unilateral_Mastectomy_Right = new Lazy(this.Unilateral_Mastectomy_Right_Value); - __Unilateral_Mastectomy__Unspecified_Laterality = new Lazy(this.Unilateral_Mastectomy__Unspecified_Laterality_Value); - __Measurement_Period = new Lazy>(this.Measurement_Period_Value); - __Patient = new Lazy(this.Patient_Value); - __SDE_Ethnicity = new Lazy>(this.SDE_Ethnicity_Value); - __SDE_Payer = new Lazy>(this.SDE_Payer_Value); - __SDE_Race = new Lazy>(this.SDE_Race_Value); - __SDE_Sex = new Lazy(this.SDE_Sex_Value); - __Telehealth_Services = new Lazy>(this.Telehealth_Services_Value); - __Age_at_start_of_Measurement_Period = new Lazy(this.Age_at_start_of_Measurement_Period_Value); - __Initial_Population = new Lazy(this.Initial_Population_Value); - __Denominator = new Lazy(this.Denominator_Value); - __Right_Mastectomy_Diagnosis = new Lazy>(this.Right_Mastectomy_Diagnosis_Value); - __Right_Mastectomy_Procedure = new Lazy>(this.Right_Mastectomy_Procedure_Value); - __Left_Mastectomy_Diagnosis = new Lazy>(this.Left_Mastectomy_Diagnosis_Value); - __Left_Mastectomy_Procedure = new Lazy>(this.Left_Mastectomy_Procedure_Value); - __Bilateral_Mastectomy_Diagnosis = new Lazy>(this.Bilateral_Mastectomy_Diagnosis_Value); - __Bilateral_Mastectomy_Procedure = new Lazy>(this.Bilateral_Mastectomy_Procedure_Value); - __Denominator_Exclusions = new Lazy(this.Denominator_Exclusions_Value); - __Observation_with_status = new Lazy(this.Observation_with_status_Value); - __Diagnostic_Report_with_status = new Lazy(this.Diagnostic_Report_with_status_Value); - __Numerator = new Lazy(this.Numerator_Value); - __Final_Numerator_Population = new Lazy(this.Final_Numerator_Population_Value); - __Observation_without_appropriate_status = new Lazy(this.Observation_without_appropriate_status_Value); - __Diagnostic_Report_without_appropriate_status = new Lazy(this.Diagnostic_Report_without_appropriate_status_Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - public SupplementalDataElementsFHIR4_2_0_000 SupplementalDataElementsFHIR4_2_0_000 { get; } - public MATGlobalCommonFunctionsFHIR4_6_1_000 MATGlobalCommonFunctionsFHIR4_6_1_000 { get; } - public AdultOutpatientEncountersFHIR4_2_2_000 AdultOutpatientEncountersFHIR4_2_2_000 { get; } - public AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 { get; } - public PalliativeCareFHIR_0_6_000 PalliativeCareFHIR_0_6_000 { get; } - public CumulativeMedicationDurationFHIR4_1_0_000 CumulativeMedicationDurationFHIR4_1_0_000 { get; } - public HospiceFHIR4_2_3_000 HospiceFHIR4_2_3_000 { get; } - - #endregion - - private CqlValueSet Bilateral_Mastectomy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1005", null); + public static BreastCancerScreeningsFHIR_0_0_009 Instance { get; } = new(); [CqlDeclaration("Bilateral Mastectomy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1005")] - public CqlValueSet Bilateral_Mastectomy() => - __Bilateral_Mastectomy.Value; - - private CqlValueSet History_of_bilateral_mastectomy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1068", null); + public CqlValueSet Bilateral_Mastectomy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1005", null); [CqlDeclaration("History of bilateral mastectomy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1068")] - public CqlValueSet History_of_bilateral_mastectomy() => - __History_of_bilateral_mastectomy.Value; - - private CqlValueSet Left_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.122.12.1036", null); + public CqlValueSet History_of_bilateral_mastectomy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1068", null); [CqlDeclaration("Left")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.122.12.1036")] - public CqlValueSet Left() => - __Left.Value; - - private CqlValueSet Mammography_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.11.1047", null); + public CqlValueSet Left(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.122.12.1036", null); [CqlDeclaration("Mammography")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.11.1047")] - public CqlValueSet Mammography() => - __Mammography.Value; - - private CqlValueSet Online_Assessments_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089", null); + public CqlValueSet Mammography(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.11.1047", null); [CqlDeclaration("Online Assessments")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089")] - public CqlValueSet Online_Assessments() => - __Online_Assessments.Value; - - private CqlValueSet Right_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.122.12.1035", null); + public CqlValueSet Online_Assessments(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089", null); [CqlDeclaration("Right")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.122.12.1035")] - public CqlValueSet Right() => - __Right.Value; - - private CqlValueSet Status_Post_Left_Mastectomy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1069", null); + public CqlValueSet Right(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.122.12.1035", null); [CqlDeclaration("Status Post Left Mastectomy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1069")] - public CqlValueSet Status_Post_Left_Mastectomy() => - __Status_Post_Left_Mastectomy.Value; - - private CqlValueSet Status_Post_Right_Mastectomy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1070", null); + public CqlValueSet Status_Post_Left_Mastectomy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1069", null); [CqlDeclaration("Status Post Right Mastectomy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1070")] - public CqlValueSet Status_Post_Right_Mastectomy() => - __Status_Post_Right_Mastectomy.Value; - - private CqlValueSet Telephone_Visits_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080", null); + public CqlValueSet Status_Post_Right_Mastectomy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1070", null); [CqlDeclaration("Telephone Visits")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080")] - public CqlValueSet Telephone_Visits() => - __Telephone_Visits.Value; - - private CqlValueSet Unilateral_Mastectomy_Left_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1133", null); + public CqlValueSet Telephone_Visits(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080", null); [CqlDeclaration("Unilateral Mastectomy Left")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1133")] - public CqlValueSet Unilateral_Mastectomy_Left() => - __Unilateral_Mastectomy_Left.Value; - - private CqlValueSet Unilateral_Mastectomy_Right_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1134", null); + public CqlValueSet Unilateral_Mastectomy_Left(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1133", null); [CqlDeclaration("Unilateral Mastectomy Right")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1134")] - public CqlValueSet Unilateral_Mastectomy_Right() => - __Unilateral_Mastectomy_Right.Value; - - private CqlValueSet Unilateral_Mastectomy__Unspecified_Laterality_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1071", null); + public CqlValueSet Unilateral_Mastectomy_Right(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1134", null); [CqlDeclaration("Unilateral Mastectomy, Unspecified Laterality")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1071")] - public CqlValueSet Unilateral_Mastectomy__Unspecified_Laterality() => - __Unilateral_Mastectomy__Unspecified_Laterality.Value; + public CqlValueSet Unilateral_Mastectomy__Unspecified_Laterality(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1071", null); - private CqlInterval Measurement_Period_Value() + [CqlDeclaration("Measurement Period")] + public CqlInterval Measurement_Period(CqlContext context) { var a_ = context.Operators.ConvertIntegerToDecimal(default); var b_ = context.Operators.DateTime((int?)2021, (int?)1, (int?)1, (int?)0, (int?)0, (int?)0, (int?)0, a_); @@ -225,11 +88,8 @@ private CqlInterval Measurement_Period_Value() return (CqlInterval)f_; } - [CqlDeclaration("Measurement Period")] - public CqlInterval Measurement_Period() => - __Measurement_Period.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -237,67 +97,52 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - - private IEnumerable SDE_Ethnicity_Value() - { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Ethnicity(); - - return a_; - } - [CqlDeclaration("SDE Ethnicity")] - public IEnumerable SDE_Ethnicity() => - __SDE_Ethnicity.Value; - - private IEnumerable SDE_Payer_Value() + public IEnumerable SDE_Ethnicity(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Payer(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Ethnicity(context); return a_; } [CqlDeclaration("SDE Payer")] - public IEnumerable SDE_Payer() => - __SDE_Payer.Value; - - private IEnumerable SDE_Race_Value() + public IEnumerable SDE_Payer(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Race(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Payer(context); return a_; } [CqlDeclaration("SDE Race")] - public IEnumerable SDE_Race() => - __SDE_Race.Value; - - private CqlCode SDE_Sex_Value() + public IEnumerable SDE_Race(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Sex(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Race(context); return a_; } [CqlDeclaration("SDE Sex")] - public CqlCode SDE_Sex() => - __SDE_Sex.Value; + public CqlCode SDE_Sex(CqlContext context) + { + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Sex(context); - private IEnumerable Telehealth_Services_Value() + return a_; + } + + [CqlDeclaration("Telehealth Services")] + public IEnumerable Telehealth_Services(CqlContext context) { - var a_ = this.Online_Assessments(); + var a_ = this.Online_Assessments(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Telephone_Visits(); + var c_ = this.Telephone_Visits(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); var e_ = context.Operators.ListUnion(b_, d_); bool? f_(Encounter TelehealthEncounter) { var h_ = context.Operators.Convert(TelehealthEncounter?.StatusElement); var i_ = context.Operators.Equal(h_, "finished"); - var j_ = this.Measurement_Period(); - var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((TelehealthEncounter?.Period as object)); + var j_ = this.Measurement_Period(context); + var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (TelehealthEncounter?.Period as object)); var l_ = context.Operators.IntervalIncludesInterval(j_, k_, null); var m_ = context.Operators.And(i_, l_); @@ -308,15 +153,12 @@ private IEnumerable Telehealth_Services_Value() return g_; } - [CqlDeclaration("Telehealth Services")] - public IEnumerable Telehealth_Services() => - __Telehealth_Services.Value; - - private int? Age_at_start_of_Measurement_Period_Value() + [CqlDeclaration("Age at start of Measurement Period")] + public int? Age_at_start_of_Measurement_Period(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); @@ -324,15 +166,12 @@ public IEnumerable Telehealth_Services() => return f_; } - [CqlDeclaration("Age at start of Measurement Period")] - public int? Age_at_start_of_Measurement_Period() => - __Age_at_start_of_Measurement_Period.Value; - - private bool? Initial_Population_Value() + [CqlDeclaration("Initial Population")] + public bool? Initial_Population(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); @@ -341,8 +180,8 @@ public IEnumerable Telehealth_Services() => var j_ = context.Operators.Convert(a_?.GenderElement); var k_ = context.Operators.Equal(j_, "female"); var l_ = context.Operators.And(h_, k_); - var m_ = AdultOutpatientEncountersFHIR4_2_2_000.Qualifying_Encounters(); - var n_ = this.Telehealth_Services(); + var m_ = AdultOutpatientEncountersFHIR4_2_2_000.Instance.Qualifying_Encounters(context); + var n_ = this.Telehealth_Services(context); var o_ = context.Operators.ListUnion(m_, n_); var p_ = context.Operators.ExistsInList(o_); var q_ = context.Operators.And(l_, p_); @@ -350,37 +189,31 @@ public IEnumerable Telehealth_Services() => return q_; } - [CqlDeclaration("Initial Population")] - public bool? Initial_Population() => - __Initial_Population.Value; - - private bool? Denominator_Value() + [CqlDeclaration("Denominator")] + public bool? Denominator(CqlContext context) { - var a_ = this.Initial_Population(); + var a_ = this.Initial_Population(context); return a_; } - [CqlDeclaration("Denominator")] - public bool? Denominator() => - __Denominator.Value; - - private IEnumerable Right_Mastectomy_Diagnosis_Value() + [CqlDeclaration("Right Mastectomy Diagnosis")] + public IEnumerable Right_Mastectomy_Diagnosis(CqlContext context) { - var a_ = this.Status_Post_Right_Mastectomy(); + var a_ = this.Status_Post_Right_Mastectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Unilateral_Mastectomy__Unspecified_Laterality(); + var c_ = this.Unilateral_Mastectomy__Unspecified_Laterality(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); bool? e_(Condition UnilateralMastectomyDiagnosis) { CqlConcept j_(CodeableConcept X) { - var n_ = FHIRHelpers_4_0_001.ToConcept(X); + var n_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return n_; }; var k_ = context.Operators.SelectOrNull((UnilateralMastectomyDiagnosis?.BodySite as IEnumerable), j_); - var l_ = this.Right(); + var l_ = this.Right(context); var m_ = context.Operators.ConceptsInValueSet(k_, l_); return m_; @@ -389,9 +222,9 @@ CqlConcept j_(CodeableConcept X) var g_ = context.Operators.ListUnion(b_, f_); bool? h_(Condition RightMastectomy) { - var o_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(RightMastectomy); + var o_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, RightMastectomy); var p_ = context.Operators.Start(o_); - var q_ = this.Measurement_Period(); + var q_ = this.Measurement_Period(context); var r_ = context.Operators.End(q_); var s_ = context.Operators.SameOrBefore(p_, r_, null); @@ -402,21 +235,18 @@ CqlConcept j_(CodeableConcept X) return i_; } - [CqlDeclaration("Right Mastectomy Diagnosis")] - public IEnumerable Right_Mastectomy_Diagnosis() => - __Right_Mastectomy_Diagnosis.Value; - - private IEnumerable Right_Mastectomy_Procedure_Value() + [CqlDeclaration("Right Mastectomy Procedure")] + public IEnumerable Right_Mastectomy_Procedure(CqlContext context) { - var a_ = this.Unilateral_Mastectomy_Right(); + var a_ = this.Unilateral_Mastectomy_Right(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure UnilateralMastectomyRightPerformed) { var e_ = context.Operators.Convert(UnilateralMastectomyRightPerformed?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(UnilateralMastectomyRightPerformed?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, UnilateralMastectomyRightPerformed?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.SameOrBefore(h_, j_, null); var l_ = context.Operators.And(f_, k_); @@ -428,26 +258,23 @@ private IEnumerable Right_Mastectomy_Procedure_Value() return d_; } - [CqlDeclaration("Right Mastectomy Procedure")] - public IEnumerable Right_Mastectomy_Procedure() => - __Right_Mastectomy_Procedure.Value; - - private IEnumerable Left_Mastectomy_Diagnosis_Value() + [CqlDeclaration("Left Mastectomy Diagnosis")] + public IEnumerable Left_Mastectomy_Diagnosis(CqlContext context) { - var a_ = this.Status_Post_Left_Mastectomy(); + var a_ = this.Status_Post_Left_Mastectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Unilateral_Mastectomy__Unspecified_Laterality(); + var c_ = this.Unilateral_Mastectomy__Unspecified_Laterality(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); bool? e_(Condition UnilateralMastectomyDiagnosis) { CqlConcept j_(CodeableConcept X) { - var n_ = FHIRHelpers_4_0_001.ToConcept(X); + var n_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, X); return n_; }; var k_ = context.Operators.SelectOrNull((UnilateralMastectomyDiagnosis?.BodySite as IEnumerable), j_); - var l_ = this.Left(); + var l_ = this.Left(context); var m_ = context.Operators.ConceptsInValueSet(k_, l_); return m_; @@ -456,9 +283,9 @@ CqlConcept j_(CodeableConcept X) var g_ = context.Operators.ListUnion(b_, f_); bool? h_(Condition LeftMastectomy) { - var o_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(LeftMastectomy); + var o_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, LeftMastectomy); var p_ = context.Operators.Start(o_); - var q_ = this.Measurement_Period(); + var q_ = this.Measurement_Period(context); var r_ = context.Operators.End(q_); var s_ = context.Operators.SameOrBefore(p_, r_, null); @@ -469,21 +296,18 @@ CqlConcept j_(CodeableConcept X) return i_; } - [CqlDeclaration("Left Mastectomy Diagnosis")] - public IEnumerable Left_Mastectomy_Diagnosis() => - __Left_Mastectomy_Diagnosis.Value; - - private IEnumerable Left_Mastectomy_Procedure_Value() + [CqlDeclaration("Left Mastectomy Procedure")] + public IEnumerable Left_Mastectomy_Procedure(CqlContext context) { - var a_ = this.Unilateral_Mastectomy_Left(); + var a_ = this.Unilateral_Mastectomy_Left(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure UnilateralMastectomyLeftPerformed) { var e_ = context.Operators.Convert(UnilateralMastectomyLeftPerformed?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(UnilateralMastectomyLeftPerformed?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, UnilateralMastectomyLeftPerformed?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.SameOrBefore(h_, j_, null); var l_ = context.Operators.And(f_, k_); @@ -495,19 +319,16 @@ private IEnumerable Left_Mastectomy_Procedure_Value() return d_; } - [CqlDeclaration("Left Mastectomy Procedure")] - public IEnumerable Left_Mastectomy_Procedure() => - __Left_Mastectomy_Procedure.Value; - - private IEnumerable Bilateral_Mastectomy_Diagnosis_Value() + [CqlDeclaration("Bilateral Mastectomy Diagnosis")] + public IEnumerable Bilateral_Mastectomy_Diagnosis(CqlContext context) { - var a_ = this.History_of_bilateral_mastectomy(); + var a_ = this.History_of_bilateral_mastectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Condition BilateralMastectomyHistory) { - var e_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(BilateralMastectomyHistory); + var e_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, BilateralMastectomyHistory); var f_ = context.Operators.Start(e_); - var g_ = this.Measurement_Period(); + var g_ = this.Measurement_Period(context); var h_ = context.Operators.End(g_); var i_ = context.Operators.SameOrBefore(f_, h_, null); @@ -518,21 +339,18 @@ private IEnumerable Bilateral_Mastectomy_Diagnosis_Value() return d_; } - [CqlDeclaration("Bilateral Mastectomy Diagnosis")] - public IEnumerable Bilateral_Mastectomy_Diagnosis() => - __Bilateral_Mastectomy_Diagnosis.Value; - - private IEnumerable Bilateral_Mastectomy_Procedure_Value() + [CqlDeclaration("Bilateral Mastectomy Procedure")] + public IEnumerable Bilateral_Mastectomy_Procedure(CqlContext context) { - var a_ = this.Bilateral_Mastectomy(); + var a_ = this.Bilateral_Mastectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure BilateralMastectomyPerformed) { var e_ = context.Operators.Convert(BilateralMastectomyPerformed?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(BilateralMastectomyPerformed?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, BilateralMastectomyPerformed?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.SameOrBefore(h_, j_, null); var l_ = context.Operators.And(f_, k_); @@ -544,56 +362,50 @@ private IEnumerable Bilateral_Mastectomy_Procedure_Value() return d_; } - [CqlDeclaration("Bilateral Mastectomy Procedure")] - public IEnumerable Bilateral_Mastectomy_Procedure() => - __Bilateral_Mastectomy_Procedure.Value; - - private bool? Denominator_Exclusions_Value() + [CqlDeclaration("Denominator Exclusions")] + public bool? Denominator_Exclusions(CqlContext context) { - var a_ = HospiceFHIR4_2_3_000.Has_Hospice(); - var b_ = this.Right_Mastectomy_Diagnosis(); + var a_ = HospiceFHIR4_2_3_000.Instance.Has_Hospice(context); + var b_ = this.Right_Mastectomy_Diagnosis(context); var c_ = context.Operators.ExistsInList(b_); - var d_ = this.Right_Mastectomy_Procedure(); + var d_ = this.Right_Mastectomy_Procedure(context); var e_ = context.Operators.ExistsInList(d_); var f_ = context.Operators.Or(c_, e_); - var g_ = this.Left_Mastectomy_Diagnosis(); + var g_ = this.Left_Mastectomy_Diagnosis(context); var h_ = context.Operators.ExistsInList(g_); - var i_ = this.Left_Mastectomy_Procedure(); + var i_ = this.Left_Mastectomy_Procedure(context); var j_ = context.Operators.ExistsInList(i_); var k_ = context.Operators.Or(h_, j_); var l_ = context.Operators.And(f_, k_); var m_ = context.Operators.Or(a_, l_); - var n_ = this.Bilateral_Mastectomy_Diagnosis(); + var n_ = this.Bilateral_Mastectomy_Diagnosis(context); var o_ = context.Operators.ExistsInList(n_); var p_ = context.Operators.Or(m_, o_); - var q_ = this.Bilateral_Mastectomy_Procedure(); + var q_ = this.Bilateral_Mastectomy_Procedure(context); var r_ = context.Operators.ExistsInList(q_); var s_ = context.Operators.Or(p_, r_); - var t_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(); + var t_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Instance.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(context); var u_ = context.Operators.Or(s_, t_); - var v_ = this.Patient(); + var v_ = this.Patient(context); var w_ = context.Operators.Convert(v_?.BirthDateElement?.Value); - var x_ = this.Measurement_Period(); + var x_ = this.Measurement_Period(context); var y_ = context.Operators.Start(x_); var z_ = context.Operators.DateFrom(y_); var aa_ = context.Operators.CalculateAgeAt(w_, z_, "year"); var ab_ = context.Operators.GreaterOrEqual(aa_, (int?)65); - var ac_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days(); + var ac_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Instance.Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days(context); var ad_ = context.Operators.And(ab_, ac_); var ae_ = context.Operators.Or(u_, ad_); - var af_ = PalliativeCareFHIR_0_6_000.Palliative_Care_in_the_Measurement_Period(); + var af_ = PalliativeCareFHIR_0_6_000.Instance.Palliative_Care_in_the_Measurement_Period(context); var ag_ = context.Operators.Or(ae_, af_); return ag_; } - [CqlDeclaration("Denominator Exclusions")] - public bool? Denominator_Exclusions() => - __Denominator_Exclusions.Value; - - private bool? Observation_with_status_Value() + [CqlDeclaration("Observation with status")] + public bool? Observation_with_status(CqlContext context) { - var a_ = this.Mammography(); + var a_ = this.Mammography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation Mammogram) { @@ -606,9 +418,9 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => "appended", }; var h_ = context.Operators.InList(f_, (g_ as IEnumerable)); - var i_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Mammogram?.Effective); + var i_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Mammogram?.Effective); var j_ = context.Operators.End(i_); - var k_ = this.Measurement_Period(); + var k_ = this.Measurement_Period(context); var l_ = context.Operators.End(k_); var m_ = context.Operators.Quantity(27m, "months"); var n_ = context.Operators.Subtract(l_, m_); @@ -628,13 +440,10 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => return e_; } - [CqlDeclaration("Observation with status")] - public bool? Observation_with_status() => - __Observation_with_status.Value; - - private bool? Diagnostic_Report_with_status_Value() + [CqlDeclaration("Diagnostic Report with status")] + public bool? Diagnostic_Report_with_status(CqlContext context) { - var a_ = this.Mammography(); + var a_ = this.Mammography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(DiagnosticReport Mammogram) { @@ -647,9 +456,9 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => "appended", }; var h_ = context.Operators.InList(f_, (g_ as IEnumerable)); - var i_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Mammogram?.Effective); + var i_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Mammogram?.Effective); var j_ = context.Operators.End(i_); - var k_ = this.Measurement_Period(); + var k_ = this.Measurement_Period(context); var l_ = context.Operators.End(k_); var m_ = context.Operators.Quantity(27m, "months"); var n_ = context.Operators.Subtract(l_, m_); @@ -669,44 +478,35 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => return e_; } - [CqlDeclaration("Diagnostic Report with status")] - public bool? Diagnostic_Report_with_status() => - __Diagnostic_Report_with_status.Value; - - private bool? Numerator_Value() + [CqlDeclaration("Numerator")] + public bool? Numerator(CqlContext context) { - var a_ = this.Observation_with_status(); - var b_ = this.Diagnostic_Report_with_status(); + var a_ = this.Observation_with_status(context); + var b_ = this.Diagnostic_Report_with_status(context); var c_ = context.Operators.Or(a_, b_); return c_; } - [CqlDeclaration("Numerator")] - public bool? Numerator() => - __Numerator.Value; - - private bool? Final_Numerator_Population_Value() + [CqlDeclaration("Final Numerator Population")] + public bool? Final_Numerator_Population(CqlContext context) { - var a_ = this.Numerator(); - var b_ = this.Initial_Population(); + var a_ = this.Numerator(context); + var b_ = this.Initial_Population(context); var c_ = context.Operators.And(a_, b_); - var d_ = this.Denominator(); + var d_ = this.Denominator(context); var e_ = context.Operators.And(c_, d_); - var f_ = this.Denominator_Exclusions(); + var f_ = this.Denominator_Exclusions(context); var g_ = context.Operators.Not(f_); var h_ = context.Operators.And(e_, g_); return h_; } - [CqlDeclaration("Final Numerator Population")] - public bool? Final_Numerator_Population() => - __Final_Numerator_Population.Value; - - private bool? Observation_without_appropriate_status_Value() + [CqlDeclaration("Observation without appropriate status")] + public bool? Observation_without_appropriate_status(CqlContext context) { - var a_ = this.Mammography(); + var a_ = this.Mammography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation Mammogram) { @@ -720,9 +520,9 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => }; var h_ = context.Operators.InList(f_, (g_ as IEnumerable)); var i_ = context.Operators.Not(h_); - var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Mammogram?.Effective); + var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Mammogram?.Effective); var k_ = context.Operators.End(j_); - var l_ = this.Measurement_Period(); + var l_ = this.Measurement_Period(context); var m_ = context.Operators.End(l_); var n_ = context.Operators.Quantity(27m, "months"); var o_ = context.Operators.Subtract(m_, n_); @@ -742,13 +542,10 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => return e_; } - [CqlDeclaration("Observation without appropriate status")] - public bool? Observation_without_appropriate_status() => - __Observation_without_appropriate_status.Value; - - private bool? Diagnostic_Report_without_appropriate_status_Value() + [CqlDeclaration("Diagnostic Report without appropriate status")] + public bool? Diagnostic_Report_without_appropriate_status(CqlContext context) { - var a_ = this.Mammography(); + var a_ = this.Mammography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(DiagnosticReport Mammogram) { @@ -762,9 +559,9 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => }; var h_ = context.Operators.InList(f_, (g_ as IEnumerable)); var i_ = context.Operators.Not(h_); - var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Mammogram?.Effective); + var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Mammogram?.Effective); var k_ = context.Operators.End(j_); - var l_ = this.Measurement_Period(); + var l_ = this.Measurement_Period(context); var m_ = context.Operators.End(l_); var n_ = context.Operators.Quantity(27m, "months"); var o_ = context.Operators.Subtract(m_, n_); @@ -784,8 +581,4 @@ public IEnumerable Bilateral_Mastectomy_Procedure() => return e_; } - [CqlDeclaration("Diagnostic Report without appropriate status")] - public bool? Diagnostic_Report_without_appropriate_status() => - __Diagnostic_Report_without_appropriate_status.Value; - } \ No newline at end of file diff --git a/Demo/Measures/CervicalCancerScreeningFHIR-0.0.005.cs b/Demo/Measures/CervicalCancerScreeningFHIR-0.0.005.cs index c263eedf3..4df940bf7 100644 --- a/Demo/Measures/CervicalCancerScreeningFHIR-0.0.005.cs +++ b/Demo/Measures/CervicalCancerScreeningFHIR-0.0.005.cs @@ -14,178 +14,64 @@ public class CervicalCancerScreeningFHIR_0_0_005 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __Congenital_or_Acquired_Absence_of_Cervix; - internal Lazy __Home_Healthcare_Services; - internal Lazy __HPV_Test; - internal Lazy __Hysterectomy_with_No_Residual_Cervix; - internal Lazy __Office_Visit; - internal Lazy __Online_Assessments; - internal Lazy __Pap_Test; - internal Lazy __Preventive_Care_Services___Established_Office_Visit__18_and_Up; - internal Lazy __Preventive_Care_Services_Initial_Office_Visit__18_and_Up; - internal Lazy __Telephone_Visits; - internal Lazy __laboratory; - internal Lazy __ObservationCategoryCodes; - internal Lazy> __Measurement_Period; - internal Lazy __Patient; - internal Lazy> __SDE_Ethnicity; - internal Lazy> __SDE_Payer; - internal Lazy> __SDE_Race; - internal Lazy __SDE_Sex; - internal Lazy> __Qualifying_Encounters; - internal Lazy __Initial_Population; - internal Lazy __Denominator; - internal Lazy> __Absence_of_Cervix; - internal Lazy __Denominator_Exclusions; - internal Lazy> __Cervical_Cytology_Within_3_Years; - internal Lazy> __HPV_Test_Within_5_Years_for_Women_Age_30_and_Older; - internal Lazy __Numerator; - internal Lazy> __Cervical_Cytology_Within_3_Years__2_; - internal Lazy> __HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2_; - - #endregion - public CervicalCancerScreeningFHIR_0_0_005(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - SupplementalDataElementsFHIR4_2_0_000 = new SupplementalDataElementsFHIR4_2_0_000(context); - MATGlobalCommonFunctionsFHIR4_6_1_000 = new MATGlobalCommonFunctionsFHIR4_6_1_000(context); - HospiceFHIR4_2_3_000 = new HospiceFHIR4_2_3_000(context); - PalliativeCareFHIR_0_6_000 = new PalliativeCareFHIR_0_6_000(context); - - __Congenital_or_Acquired_Absence_of_Cervix = new Lazy(this.Congenital_or_Acquired_Absence_of_Cervix_Value); - __Home_Healthcare_Services = new Lazy(this.Home_Healthcare_Services_Value); - __HPV_Test = new Lazy(this.HPV_Test_Value); - __Hysterectomy_with_No_Residual_Cervix = new Lazy(this.Hysterectomy_with_No_Residual_Cervix_Value); - __Office_Visit = new Lazy(this.Office_Visit_Value); - __Online_Assessments = new Lazy(this.Online_Assessments_Value); - __Pap_Test = new Lazy(this.Pap_Test_Value); - __Preventive_Care_Services___Established_Office_Visit__18_and_Up = new Lazy(this.Preventive_Care_Services___Established_Office_Visit__18_and_Up_Value); - __Preventive_Care_Services_Initial_Office_Visit__18_and_Up = new Lazy(this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up_Value); - __Telephone_Visits = new Lazy(this.Telephone_Visits_Value); - __laboratory = new Lazy(this.laboratory_Value); - __ObservationCategoryCodes = new Lazy(this.ObservationCategoryCodes_Value); - __Measurement_Period = new Lazy>(this.Measurement_Period_Value); - __Patient = new Lazy(this.Patient_Value); - __SDE_Ethnicity = new Lazy>(this.SDE_Ethnicity_Value); - __SDE_Payer = new Lazy>(this.SDE_Payer_Value); - __SDE_Race = new Lazy>(this.SDE_Race_Value); - __SDE_Sex = new Lazy(this.SDE_Sex_Value); - __Qualifying_Encounters = new Lazy>(this.Qualifying_Encounters_Value); - __Initial_Population = new Lazy(this.Initial_Population_Value); - __Denominator = new Lazy(this.Denominator_Value); - __Absence_of_Cervix = new Lazy>(this.Absence_of_Cervix_Value); - __Denominator_Exclusions = new Lazy(this.Denominator_Exclusions_Value); - __Cervical_Cytology_Within_3_Years = new Lazy>(this.Cervical_Cytology_Within_3_Years_Value); - __HPV_Test_Within_5_Years_for_Women_Age_30_and_Older = new Lazy>(this.HPV_Test_Within_5_Years_for_Women_Age_30_and_Older_Value); - __Numerator = new Lazy(this.Numerator_Value); - __Cervical_Cytology_Within_3_Years__2_ = new Lazy>(this.Cervical_Cytology_Within_3_Years__2__Value); - __HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2_ = new Lazy>(this.HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2__Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - public SupplementalDataElementsFHIR4_2_0_000 SupplementalDataElementsFHIR4_2_0_000 { get; } - public MATGlobalCommonFunctionsFHIR4_6_1_000 MATGlobalCommonFunctionsFHIR4_6_1_000 { get; } - public HospiceFHIR4_2_3_000 HospiceFHIR4_2_3_000 { get; } - public PalliativeCareFHIR_0_6_000 PalliativeCareFHIR_0_6_000 { get; } - - #endregion - - private CqlValueSet Congenital_or_Acquired_Absence_of_Cervix_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.111.12.1016", null); + public static CervicalCancerScreeningFHIR_0_0_005 Instance { get; } = new(); [CqlDeclaration("Congenital or Acquired Absence of Cervix")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.111.12.1016")] - public CqlValueSet Congenital_or_Acquired_Absence_of_Cervix() => - __Congenital_or_Acquired_Absence_of_Cervix.Value; - - private CqlValueSet Home_Healthcare_Services_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016", null); + public CqlValueSet Congenital_or_Acquired_Absence_of_Cervix(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.111.12.1016", null); [CqlDeclaration("Home Healthcare Services")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016")] - public CqlValueSet Home_Healthcare_Services() => - __Home_Healthcare_Services.Value; - - private CqlValueSet HPV_Test_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1059", null); + public CqlValueSet Home_Healthcare_Services(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016", null); [CqlDeclaration("HPV Test")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1059")] - public CqlValueSet HPV_Test() => - __HPV_Test.Value; - - private CqlValueSet Hysterectomy_with_No_Residual_Cervix_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1014", null); + public CqlValueSet HPV_Test(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1059", null); [CqlDeclaration("Hysterectomy with No Residual Cervix")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1014")] - public CqlValueSet Hysterectomy_with_No_Residual_Cervix() => - __Hysterectomy_with_No_Residual_Cervix.Value; - - private CqlValueSet Office_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001", null); + public CqlValueSet Hysterectomy_with_No_Residual_Cervix(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1014", null); [CqlDeclaration("Office Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001")] - public CqlValueSet Office_Visit() => - __Office_Visit.Value; - - private CqlValueSet Online_Assessments_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089", null); + public CqlValueSet Office_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001", null); [CqlDeclaration("Online Assessments")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089")] - public CqlValueSet Online_Assessments() => - __Online_Assessments.Value; - - private CqlValueSet Pap_Test_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1017", null); + public CqlValueSet Online_Assessments(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089", null); [CqlDeclaration("Pap Test")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1017")] - public CqlValueSet Pap_Test() => - __Pap_Test.Value; - - private CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025", null); + public CqlValueSet Pap_Test(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1017", null); [CqlDeclaration("Preventive Care Services - Established Office Visit, 18 and Up")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025")] - public CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up() => - __Preventive_Care_Services___Established_Office_Visit__18_and_Up.Value; - - private CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023", null); + public CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025", null); [CqlDeclaration("Preventive Care Services-Initial Office Visit, 18 and Up")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023")] - public CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up() => - __Preventive_Care_Services_Initial_Office_Visit__18_and_Up.Value; - - private CqlValueSet Telephone_Visits_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080", null); + public CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023", null); [CqlDeclaration("Telephone Visits")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080")] - public CqlValueSet Telephone_Visits() => - __Telephone_Visits.Value; - - private CqlCode laboratory_Value() => - new CqlCode("laboratory", "http://terminology.hl7.org/CodeSystem/observation-category", null, null); + public CqlValueSet Telephone_Visits(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080", null); [CqlDeclaration("laboratory")] - public CqlCode laboratory() => - __laboratory.Value; + public CqlCode laboratory(CqlContext context) => + new CqlCode("laboratory", "http://terminology.hl7.org/CodeSystem/observation-category", null, null); - private CqlCode[] ObservationCategoryCodes_Value() + [CqlDeclaration("ObservationCategoryCodes")] + public CqlCode[] ObservationCategoryCodes(CqlContext context) { var a_ = new CqlCode[] { @@ -195,11 +81,8 @@ private CqlCode[] ObservationCategoryCodes_Value() return a_; } - [CqlDeclaration("ObservationCategoryCodes")] - public CqlCode[] ObservationCategoryCodes() => - __ObservationCategoryCodes.Value; - - private CqlInterval Measurement_Period_Value() + [CqlDeclaration("Measurement Period")] + public CqlInterval Measurement_Period(CqlContext context) { var a_ = context.Operators.ConvertIntegerToDecimal(default); var b_ = context.Operators.DateTime((int?)2019, (int?)1, (int?)1, (int?)0, (int?)0, (int?)0, (int?)0, a_); @@ -210,11 +93,8 @@ private CqlInterval Measurement_Period_Value() return (CqlInterval)f_; } - [CqlDeclaration("Measurement Period")] - public CqlInterval Measurement_Period() => - __Measurement_Period.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -222,70 +102,55 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - - private IEnumerable SDE_Ethnicity_Value() - { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Ethnicity(); - - return a_; - } - [CqlDeclaration("SDE Ethnicity")] - public IEnumerable SDE_Ethnicity() => - __SDE_Ethnicity.Value; - - private IEnumerable SDE_Payer_Value() + public IEnumerable SDE_Ethnicity(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Payer(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Ethnicity(context); return a_; } [CqlDeclaration("SDE Payer")] - public IEnumerable SDE_Payer() => - __SDE_Payer.Value; - - private IEnumerable SDE_Race_Value() + public IEnumerable SDE_Payer(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Race(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Payer(context); return a_; } [CqlDeclaration("SDE Race")] - public IEnumerable SDE_Race() => - __SDE_Race.Value; - - private CqlCode SDE_Sex_Value() + public IEnumerable SDE_Race(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Sex(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Race(context); return a_; } [CqlDeclaration("SDE Sex")] - public CqlCode SDE_Sex() => - __SDE_Sex.Value; + public CqlCode SDE_Sex(CqlContext context) + { + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Sex(context); - private IEnumerable Qualifying_Encounters_Value() + return a_; + } + + [CqlDeclaration("Qualifying Encounters")] + public IEnumerable Qualifying_Encounters(CqlContext context) { - var a_ = this.Office_Visit(); + var a_ = this.Office_Visit(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Preventive_Care_Services___Established_Office_Visit__18_and_Up(); + var c_ = this.Preventive_Care_Services___Established_Office_Visit__18_and_Up(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); var e_ = context.Operators.ListUnion(b_, d_); - var f_ = this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up(); + var f_ = this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up(context); var g_ = context.Operators.RetrieveByValueSet(f_, null); - var h_ = this.Home_Healthcare_Services(); + var h_ = this.Home_Healthcare_Services(context); var i_ = context.Operators.RetrieveByValueSet(h_, null); var j_ = context.Operators.ListUnion(g_, i_); var k_ = context.Operators.ListUnion(e_, j_); - var l_ = this.Telephone_Visits(); + var l_ = this.Telephone_Visits(context); var m_ = context.Operators.RetrieveByValueSet(l_, null); - var n_ = this.Online_Assessments(); + var n_ = this.Online_Assessments(context); var o_ = context.Operators.RetrieveByValueSet(n_, null); var p_ = context.Operators.ListUnion(m_, o_); var q_ = context.Operators.ListUnion(k_, p_); @@ -293,8 +158,8 @@ private IEnumerable Qualifying_Encounters_Value() { var t_ = context.Operators.Convert(ValidEncounter?.StatusElement); var u_ = context.Operators.Equal(t_, "finished"); - var v_ = this.Measurement_Period(); - var w_ = FHIRHelpers_4_0_001.ToInterval(ValidEncounter?.Period); + var v_ = this.Measurement_Period(context); + var w_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, ValidEncounter?.Period); var x_ = context.Operators.IntervalIncludesInterval(v_, w_, null); var y_ = context.Operators.And(u_, x_); @@ -305,15 +170,12 @@ private IEnumerable Qualifying_Encounters_Value() return s_; } - [CqlDeclaration("Qualifying Encounters")] - public IEnumerable Qualifying_Encounters() => - __Qualifying_Encounters.Value; - - private bool? Initial_Population_Value() + [CqlDeclaration("Initial Population")] + public bool? Initial_Population(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); @@ -322,39 +184,33 @@ public IEnumerable Qualifying_Encounters() => var j_ = context.Operators.Convert(a_?.GenderElement); var k_ = context.Operators.Equal(j_, "female"); var l_ = context.Operators.And(h_, k_); - var m_ = this.Qualifying_Encounters(); + var m_ = this.Qualifying_Encounters(context); var n_ = context.Operators.ExistsInList(m_); var o_ = context.Operators.And(l_, n_); return o_; } - [CqlDeclaration("Initial Population")] - public bool? Initial_Population() => - __Initial_Population.Value; - - private bool? Denominator_Value() + [CqlDeclaration("Denominator")] + public bool? Denominator(CqlContext context) { - var a_ = this.Initial_Population(); + var a_ = this.Initial_Population(context); return a_; } - [CqlDeclaration("Denominator")] - public bool? Denominator() => - __Denominator.Value; - - private IEnumerable Absence_of_Cervix_Value() + [CqlDeclaration("Absence of Cervix")] + public IEnumerable Absence_of_Cervix(CqlContext context) { - var a_ = this.Hysterectomy_with_No_Residual_Cervix(); + var a_ = this.Hysterectomy_with_No_Residual_Cervix(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure NoCervixProcedure) { var j_ = context.Operators.Convert(NoCervixProcedure?.StatusElement); var k_ = context.Operators.Equal(j_, "completed"); - var l_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(NoCervixProcedure?.Performed); + var l_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, NoCervixProcedure?.Performed); var m_ = context.Operators.End(l_); - var n_ = this.Measurement_Period(); + var n_ = this.Measurement_Period(context); var o_ = context.Operators.End(n_); var p_ = context.Operators.SameOrBefore(m_, o_, null); var q_ = context.Operators.And(k_, p_); @@ -362,13 +218,13 @@ private IEnumerable Absence_of_Cervix_Value() return q_; }; var d_ = context.Operators.WhereOrNull(b_, c_); - var e_ = this.Congenital_or_Acquired_Absence_of_Cervix(); + var e_ = this.Congenital_or_Acquired_Absence_of_Cervix(context); var f_ = context.Operators.RetrieveByValueSet(e_, null); bool? g_(Condition NoCervixDiagnosis) { - var r_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(NoCervixDiagnosis); + var r_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, NoCervixDiagnosis); var s_ = context.Operators.Start(r_); - var t_ = this.Measurement_Period(); + var t_ = this.Measurement_Period(context); var u_ = context.Operators.End(t_); var v_ = context.Operators.SameOrBefore(s_, u_, null); @@ -380,29 +236,23 @@ private IEnumerable Absence_of_Cervix_Value() return i_; } - [CqlDeclaration("Absence of Cervix")] - public IEnumerable Absence_of_Cervix() => - __Absence_of_Cervix.Value; - - private bool? Denominator_Exclusions_Value() + [CqlDeclaration("Denominator Exclusions")] + public bool? Denominator_Exclusions(CqlContext context) { - var a_ = HospiceFHIR4_2_3_000.Has_Hospice(); - var b_ = this.Absence_of_Cervix(); + var a_ = HospiceFHIR4_2_3_000.Instance.Has_Hospice(context); + var b_ = this.Absence_of_Cervix(context); var c_ = context.Operators.ExistsInList(b_); var d_ = context.Operators.Or(a_, c_); - var e_ = PalliativeCareFHIR_0_6_000.Palliative_Care_in_the_Measurement_Period(); + var e_ = PalliativeCareFHIR_0_6_000.Instance.Palliative_Care_in_the_Measurement_Period(context); var f_ = context.Operators.Or(d_, e_); return f_; } - [CqlDeclaration("Denominator Exclusions")] - public bool? Denominator_Exclusions() => - __Denominator_Exclusions.Value; - - private IEnumerable Cervical_Cytology_Within_3_Years_Value() + [CqlDeclaration("Cervical Cytology Within 3 Years")] + public IEnumerable Cervical_Cytology_Within_3_Years(CqlContext context) { - var a_ = this.Pap_Test(); + var a_ = this.Pap_Test(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation CervicalCytology) { @@ -416,8 +266,8 @@ private IEnumerable Cervical_Cytology_Within_3_Years_Value() var g_ = context.Operators.InList(e_, (f_ as IEnumerable)); bool? h_(CodeableConcept CervicalCytologyCategory) { - var ab_ = this.laboratory(); - var ac_ = FHIRHelpers_4_0_001.ToConcept(CervicalCytologyCategory); + var ab_ = this.laboratory(context); + var ac_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, CervicalCytologyCategory); var ad_ = context.Operators.CodeInList(ab_, (ac_?.codes as IEnumerable)); return ad_; @@ -425,8 +275,8 @@ private IEnumerable Cervical_Cytology_Within_3_Years_Value() var i_ = context.Operators.WhereOrNull((CervicalCytology?.Category as IEnumerable), h_); var j_ = context.Operators.ExistsInList(i_); var k_ = context.Operators.And(g_, j_); - var l_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(CervicalCytology?.Effective); - var m_ = this.Measurement_Period(); + var l_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, CervicalCytology?.Effective); + var m_ = this.Measurement_Period(context); var n_ = context.Operators.End(m_); var o_ = context.Operators.Quantity(3m, "years"); var p_ = context.Operators.Subtract(n_, o_); @@ -447,13 +297,10 @@ private IEnumerable Cervical_Cytology_Within_3_Years_Value() return d_; } - [CqlDeclaration("Cervical Cytology Within 3 Years")] - public IEnumerable Cervical_Cytology_Within_3_Years() => - __Cervical_Cytology_Within_3_Years.Value; - - private IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Older_Value() + [CqlDeclaration("HPV Test Within 5 Years for Women Age 30 and Older")] + public IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Older(CqlContext context) { - var a_ = this.HPV_Test(); + var a_ = this.HPV_Test(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation HPVTest) { @@ -467,8 +314,8 @@ private IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Ol var g_ = context.Operators.InList(e_, (f_ as IEnumerable)); bool? h_(CodeableConcept HPVTestCategory) { - var aj_ = this.laboratory(); - var ak_ = FHIRHelpers_4_0_001.ToConcept(HPVTestCategory); + var aj_ = this.laboratory(context); + var ak_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, HPVTestCategory); var al_ = context.Operators.CodeInList(aj_, (ak_?.codes as IEnumerable)); return al_; @@ -476,16 +323,16 @@ private IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Ol var i_ = context.Operators.WhereOrNull((HPVTest?.Category as IEnumerable), h_); var j_ = context.Operators.ExistsInList(i_); var k_ = context.Operators.And(g_, j_); - var l_ = this.Patient(); + var l_ = this.Patient(context); var m_ = context.Operators.Convert(l_?.BirthDateElement?.Value); - var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(HPVTest?.Effective); + var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, HPVTest?.Effective); var o_ = context.Operators.Start(n_); var p_ = context.Operators.DateFrom(o_); var q_ = context.Operators.CalculateAgeAt(m_, p_, "year"); var r_ = context.Operators.GreaterOrEqual(q_, (int?)30); var s_ = context.Operators.And(k_, r_); - var t_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(HPVTest?.Effective); - var u_ = this.Measurement_Period(); + var t_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, HPVTest?.Effective); + var u_ = this.Measurement_Period(context); var v_ = context.Operators.End(u_); var w_ = context.Operators.Quantity(5m, "years"); var x_ = context.Operators.Subtract(v_, w_); @@ -506,27 +353,20 @@ private IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Ol return d_; } - [CqlDeclaration("HPV Test Within 5 Years for Women Age 30 and Older")] - public IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Older() => - __HPV_Test_Within_5_Years_for_Women_Age_30_and_Older.Value; - - private bool? Numerator_Value() + [CqlDeclaration("Numerator")] + public bool? Numerator(CqlContext context) { - var a_ = this.Cervical_Cytology_Within_3_Years(); + var a_ = this.Cervical_Cytology_Within_3_Years(context); var b_ = context.Operators.ExistsInList(a_); - var c_ = this.HPV_Test_Within_5_Years_for_Women_Age_30_and_Older(); + var c_ = this.HPV_Test_Within_5_Years_for_Women_Age_30_and_Older(context); var d_ = context.Operators.ExistsInList(c_); var e_ = context.Operators.Or(b_, d_); return e_; } - [CqlDeclaration("Numerator")] - public bool? Numerator() => - __Numerator.Value; - [CqlDeclaration("isComplete")] - public bool? isComplete(Observation observation) + public bool? isComplete(CqlContext context, Observation observation) { var a_ = context.Operators.Convert(observation?.StatusElement); var b_ = new string[] @@ -541,12 +381,12 @@ public IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Old } [CqlDeclaration("isLaboratoryTest")] - public bool? isLaboratoryTest(Observation observation) + public bool? isLaboratoryTest(CqlContext context, Observation observation) { bool? a_(CodeableConcept category) { - var d_ = this.laboratory(); - var e_ = FHIRHelpers_4_0_001.ToConcept(category); + var d_ = this.laboratory(context); + var e_ = FHIRHelpers_4_0_001.Instance.ToConcept(context, category); var f_ = context.Operators.CodeInList(d_, (e_?.codes as IEnumerable)); return f_; @@ -558,24 +398,25 @@ public IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Old } [CqlDeclaration("latest")] - public CqlDateTime latest(object choice) + public CqlDateTime latest(CqlContext context, object choice) { - var a_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(choice); + var a_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, choice); return a_; } - private IEnumerable Cervical_Cytology_Within_3_Years__2__Value() + [CqlDeclaration("Cervical Cytology Within 3 Years (2)")] + public IEnumerable Cervical_Cytology_Within_3_Years__2_(CqlContext context) { - var a_ = this.Pap_Test(); + var a_ = this.Pap_Test(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation CervicalCytology) { - var e_ = this.isComplete(CervicalCytology); - var f_ = this.isLaboratoryTest(CervicalCytology); + var e_ = this.isComplete(context, CervicalCytology); + var f_ = this.isLaboratoryTest(context, CervicalCytology); var g_ = context.Operators.And(e_, f_); - var h_ = this.latest(CervicalCytology?.Effective); - var i_ = this.Measurement_Period(); + var h_ = this.latest(context, CervicalCytology?.Effective); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.Quantity(3m, "years"); var l_ = context.Operators.Subtract(j_, k_); @@ -596,37 +437,34 @@ private IEnumerable Cervical_Cytology_Within_3_Years__2__Value() return d_; } - [CqlDeclaration("Cervical Cytology Within 3 Years (2)")] - public IEnumerable Cervical_Cytology_Within_3_Years__2_() => - __Cervical_Cytology_Within_3_Years__2_.Value; - [CqlDeclaration("toInterval")] - public CqlInterval toInterval(object choice) + public CqlInterval toInterval(CqlContext context, object choice) { - var a_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(choice); + var a_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, choice); return a_; } - private IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2__Value() + [CqlDeclaration("HPV Test Within 5 Years for Women Age 30 and Older (2)")] + public IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2_(CqlContext context) { - var a_ = this.HPV_Test(); + var a_ = this.HPV_Test(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation HPVTest) { - var e_ = this.isComplete(HPVTest); - var f_ = this.isLaboratoryTest(HPVTest); + var e_ = this.isComplete(context, HPVTest); + var f_ = this.isLaboratoryTest(context, HPVTest); var g_ = context.Operators.And(e_, f_); - var h_ = this.Patient(); + var h_ = this.Patient(context); var i_ = context.Operators.Convert(h_?.BirthDateElement?.Value); - var j_ = this.toInterval(HPVTest?.Effective); + var j_ = this.toInterval(context, HPVTest?.Effective); var k_ = context.Operators.Start(j_); var l_ = context.Operators.DateFrom(k_); var m_ = context.Operators.CalculateAgeAt(i_, l_, "year"); var n_ = context.Operators.GreaterOrEqual(m_, (int?)30); var o_ = context.Operators.And(g_, n_); - var p_ = this.latest(HPVTest?.Effective); - var q_ = this.Measurement_Period(); + var p_ = this.latest(context, HPVTest?.Effective); + var q_ = this.Measurement_Period(context); var r_ = context.Operators.End(q_); var s_ = context.Operators.Quantity(5m, "years"); var t_ = context.Operators.Subtract(r_, s_); @@ -647,8 +485,4 @@ private IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Ol return d_; } - [CqlDeclaration("HPV Test Within 5 Years for Women Age 30 and Older (2)")] - public IEnumerable HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2_() => - __HPV_Test_Within_5_Years_for_Women_Age_30_and_Older__2_.Value; - } \ No newline at end of file diff --git a/Demo/Measures/ColorectalCancerScreeningsFHIR-0.0.003.cs b/Demo/Measures/ColorectalCancerScreeningsFHIR-0.0.003.cs index 9c5fb5bff..e9ddbf6b9 100644 --- a/Demo/Measures/ColorectalCancerScreeningsFHIR-0.0.003.cs +++ b/Demo/Measures/ColorectalCancerScreeningsFHIR-0.0.003.cs @@ -14,432 +14,169 @@ public class ColorectalCancerScreeningsFHIR_0_0_003 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __Acute_Inpatient; - internal Lazy __Advanced_Illness; - internal Lazy __Annual_Wellness_Visit; - internal Lazy __Care_Services_in_Long_Term_Residential_Facility; - internal Lazy __Colonoscopy; - internal Lazy __CT_Colonography; - internal Lazy __Dementia_Medications; - internal Lazy __Discharged_to_Health_Care_Facility_for_Hospice_Care; - internal Lazy __Discharged_to_Home_for_Hospice_Care; - internal Lazy __Encounter_Inpatient; - internal Lazy __Fecal_Occult_Blood_Test__FOBT_; - internal Lazy __FIT_DNA; - internal Lazy __Flexible_Sigmoidoscopy; - internal Lazy __Frailty_Device; - internal Lazy __Frailty_Diagnosis; - internal Lazy __Frailty_Encounter; - internal Lazy __Frailty_Symptom; - internal Lazy __Home_Healthcare_Services; - internal Lazy __Hospice_care_ambulatory; - internal Lazy __Malignant_Neoplasm_of_Colon; - internal Lazy __Nonacute_Inpatient; - internal Lazy __Nursing_Facility_Visit; - internal Lazy __Observation; - internal Lazy __Office_Visit; - internal Lazy __Online_Assessments; - internal Lazy __Outpatient; - internal Lazy __Preventive_Care_Services___Established_Office_Visit__18_and_Up; - internal Lazy __Preventive_Care_Services_Initial_Office_Visit__18_and_Up; - internal Lazy __Telephone_Visits; - internal Lazy __Total_Colectomy; - internal Lazy __Total_Colectomy_ICD9; - internal Lazy __laboratory; - internal Lazy __ObservationCategoryCodes; - internal Lazy> __Measurement_Period; - internal Lazy __Patient; - internal Lazy> __SDE_Ethnicity; - internal Lazy> __SDE_Payer; - internal Lazy> __SDE_Race; - internal Lazy __SDE_Sex; - internal Lazy> __Telehealth_Services; - internal Lazy __Age_at_start_of_Measurement_Period; - internal Lazy __Initial_Population; - internal Lazy __Denominator; - internal Lazy> __Malignant_Neoplasm; - internal Lazy> __Total_Colectomy_Performed; - internal Lazy> __Total_Colectomy_Condition; - internal Lazy __Denominator_Exclusions; - internal Lazy> __Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status; - internal Lazy> __Fecal_Occult_Blood_Test_Performed; - internal Lazy> __Fecal_Occult_Blood_Test_Performed__day_of_TZoffset; - internal Lazy> __Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset; - internal Lazy> __Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset; - internal Lazy> __Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status; - internal Lazy> __Fecal_Immunochemical_Test_DNA_Performed; - internal Lazy> __Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset; - internal Lazy> __Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset; - internal Lazy> __Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset; - internal Lazy> __CT_Colonography_Display_Date; - internal Lazy> __CT_Colonography_Performed; - internal Lazy> __CT_Colonography_Performed_without_appropriate_status; - internal Lazy> __Flexible_Sigmoidoscopy_Display_Date; - internal Lazy> __Flexible_Sigmoidoscopy_Performed; - internal Lazy> __Flexible_Sigmoidoscopy_Performed_without_appropriate_status; - internal Lazy> __Colonoscopy_Display_Date; - internal Lazy> __Colonoscopy_Performed; - internal Lazy> __Colonoscopy_Performed_without_appropriate_status; - internal Lazy __Numerator; - internal Lazy __Final_Numerator_Population; - - #endregion - public ColorectalCancerScreeningsFHIR_0_0_003(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - SupplementalDataElementsFHIR4_2_0_000 = new SupplementalDataElementsFHIR4_2_0_000(context); - MATGlobalCommonFunctionsFHIR4_6_1_000 = new MATGlobalCommonFunctionsFHIR4_6_1_000(context); - AdultOutpatientEncountersFHIR4_2_2_000 = new AdultOutpatientEncountersFHIR4_2_2_000(context); - HospiceFHIR4_2_3_000 = new HospiceFHIR4_2_3_000(context); - AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 = new AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000(context); - PalliativeCareFHIR_0_6_000 = new PalliativeCareFHIR_0_6_000(context); - CumulativeMedicationDurationFHIR4_1_0_000 = new CumulativeMedicationDurationFHIR4_1_0_000(context); - - __Acute_Inpatient = new Lazy(this.Acute_Inpatient_Value); - __Advanced_Illness = new Lazy(this.Advanced_Illness_Value); - __Annual_Wellness_Visit = new Lazy(this.Annual_Wellness_Visit_Value); - __Care_Services_in_Long_Term_Residential_Facility = new Lazy(this.Care_Services_in_Long_Term_Residential_Facility_Value); - __Colonoscopy = new Lazy(this.Colonoscopy_Value); - __CT_Colonography = new Lazy(this.CT_Colonography_Value); - __Dementia_Medications = new Lazy(this.Dementia_Medications_Value); - __Discharged_to_Health_Care_Facility_for_Hospice_Care = new Lazy(this.Discharged_to_Health_Care_Facility_for_Hospice_Care_Value); - __Discharged_to_Home_for_Hospice_Care = new Lazy(this.Discharged_to_Home_for_Hospice_Care_Value); - __Encounter_Inpatient = new Lazy(this.Encounter_Inpatient_Value); - __Fecal_Occult_Blood_Test__FOBT_ = new Lazy(this.Fecal_Occult_Blood_Test__FOBT__Value); - __FIT_DNA = new Lazy(this.FIT_DNA_Value); - __Flexible_Sigmoidoscopy = new Lazy(this.Flexible_Sigmoidoscopy_Value); - __Frailty_Device = new Lazy(this.Frailty_Device_Value); - __Frailty_Diagnosis = new Lazy(this.Frailty_Diagnosis_Value); - __Frailty_Encounter = new Lazy(this.Frailty_Encounter_Value); - __Frailty_Symptom = new Lazy(this.Frailty_Symptom_Value); - __Home_Healthcare_Services = new Lazy(this.Home_Healthcare_Services_Value); - __Hospice_care_ambulatory = new Lazy(this.Hospice_care_ambulatory_Value); - __Malignant_Neoplasm_of_Colon = new Lazy(this.Malignant_Neoplasm_of_Colon_Value); - __Nonacute_Inpatient = new Lazy(this.Nonacute_Inpatient_Value); - __Nursing_Facility_Visit = new Lazy(this.Nursing_Facility_Visit_Value); - __Observation = new Lazy(this.Observation_Value); - __Office_Visit = new Lazy(this.Office_Visit_Value); - __Online_Assessments = new Lazy(this.Online_Assessments_Value); - __Outpatient = new Lazy(this.Outpatient_Value); - __Preventive_Care_Services___Established_Office_Visit__18_and_Up = new Lazy(this.Preventive_Care_Services___Established_Office_Visit__18_and_Up_Value); - __Preventive_Care_Services_Initial_Office_Visit__18_and_Up = new Lazy(this.Preventive_Care_Services_Initial_Office_Visit__18_and_Up_Value); - __Telephone_Visits = new Lazy(this.Telephone_Visits_Value); - __Total_Colectomy = new Lazy(this.Total_Colectomy_Value); - __Total_Colectomy_ICD9 = new Lazy(this.Total_Colectomy_ICD9_Value); - __laboratory = new Lazy(this.laboratory_Value); - __ObservationCategoryCodes = new Lazy(this.ObservationCategoryCodes_Value); - __Measurement_Period = new Lazy>(this.Measurement_Period_Value); - __Patient = new Lazy(this.Patient_Value); - __SDE_Ethnicity = new Lazy>(this.SDE_Ethnicity_Value); - __SDE_Payer = new Lazy>(this.SDE_Payer_Value); - __SDE_Race = new Lazy>(this.SDE_Race_Value); - __SDE_Sex = new Lazy(this.SDE_Sex_Value); - __Telehealth_Services = new Lazy>(this.Telehealth_Services_Value); - __Age_at_start_of_Measurement_Period = new Lazy(this.Age_at_start_of_Measurement_Period_Value); - __Initial_Population = new Lazy(this.Initial_Population_Value); - __Denominator = new Lazy(this.Denominator_Value); - __Malignant_Neoplasm = new Lazy>(this.Malignant_Neoplasm_Value); - __Total_Colectomy_Performed = new Lazy>(this.Total_Colectomy_Performed_Value); - __Total_Colectomy_Condition = new Lazy>(this.Total_Colectomy_Condition_Value); - __Denominator_Exclusions = new Lazy(this.Denominator_Exclusions_Value); - __Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status = new Lazy>(this.Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status_Value); - __Fecal_Occult_Blood_Test_Performed = new Lazy>(this.Fecal_Occult_Blood_Test_Performed_Value); - __Fecal_Occult_Blood_Test_Performed__day_of_TZoffset = new Lazy>(this.Fecal_Occult_Blood_Test_Performed__day_of_TZoffset_Value); - __Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset = new Lazy>(this.Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset_Value); - __Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset = new Lazy>(this.Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset_Value); - __Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status = new Lazy>(this.Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status_Value); - __Fecal_Immunochemical_Test_DNA_Performed = new Lazy>(this.Fecal_Immunochemical_Test_DNA_Performed_Value); - __Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset = new Lazy>(this.Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset_Value); - __Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset = new Lazy>(this.Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset_Value); - __Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset = new Lazy>(this.Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset_Value); - __CT_Colonography_Display_Date = new Lazy>(this.CT_Colonography_Display_Date_Value); - __CT_Colonography_Performed = new Lazy>(this.CT_Colonography_Performed_Value); - __CT_Colonography_Performed_without_appropriate_status = new Lazy>(this.CT_Colonography_Performed_without_appropriate_status_Value); - __Flexible_Sigmoidoscopy_Display_Date = new Lazy>(this.Flexible_Sigmoidoscopy_Display_Date_Value); - __Flexible_Sigmoidoscopy_Performed = new Lazy>(this.Flexible_Sigmoidoscopy_Performed_Value); - __Flexible_Sigmoidoscopy_Performed_without_appropriate_status = new Lazy>(this.Flexible_Sigmoidoscopy_Performed_without_appropriate_status_Value); - __Colonoscopy_Display_Date = new Lazy>(this.Colonoscopy_Display_Date_Value); - __Colonoscopy_Performed = new Lazy>(this.Colonoscopy_Performed_Value); - __Colonoscopy_Performed_without_appropriate_status = new Lazy>(this.Colonoscopy_Performed_without_appropriate_status_Value); - __Numerator = new Lazy(this.Numerator_Value); - __Final_Numerator_Population = new Lazy(this.Final_Numerator_Population_Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - public SupplementalDataElementsFHIR4_2_0_000 SupplementalDataElementsFHIR4_2_0_000 { get; } - public MATGlobalCommonFunctionsFHIR4_6_1_000 MATGlobalCommonFunctionsFHIR4_6_1_000 { get; } - public AdultOutpatientEncountersFHIR4_2_2_000 AdultOutpatientEncountersFHIR4_2_2_000 { get; } - public HospiceFHIR4_2_3_000 HospiceFHIR4_2_3_000 { get; } - public AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000 { get; } - public PalliativeCareFHIR_0_6_000 PalliativeCareFHIR_0_6_000 { get; } - public CumulativeMedicationDurationFHIR4_1_0_000 CumulativeMedicationDurationFHIR4_1_0_000 { get; } - - #endregion - - private CqlValueSet Acute_Inpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083", null); + public static ColorectalCancerScreeningsFHIR_0_0_003 Instance { get; } = new(); [CqlDeclaration("Acute Inpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083")] - public CqlValueSet Acute_Inpatient() => - __Acute_Inpatient.Value; - - private CqlValueSet Advanced_Illness_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082", null); + public CqlValueSet Acute_Inpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083", null); [CqlDeclaration("Advanced Illness")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082")] - public CqlValueSet Advanced_Illness() => - __Advanced_Illness.Value; - - private CqlValueSet Annual_Wellness_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240", null); + public CqlValueSet Advanced_Illness(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082", null); [CqlDeclaration("Annual Wellness Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240")] - public CqlValueSet Annual_Wellness_Visit() => - __Annual_Wellness_Visit.Value; - - private CqlValueSet Care_Services_in_Long_Term_Residential_Facility_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014", null); + public CqlValueSet Annual_Wellness_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240", null); [CqlDeclaration("Care Services in Long-Term Residential Facility")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014")] - public CqlValueSet Care_Services_in_Long_Term_Residential_Facility() => - __Care_Services_in_Long_Term_Residential_Facility.Value; - - private CqlValueSet Colonoscopy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1020", null); + public CqlValueSet Care_Services_in_Long_Term_Residential_Facility(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014", null); [CqlDeclaration("Colonoscopy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1020")] - public CqlValueSet Colonoscopy() => - __Colonoscopy.Value; - - private CqlValueSet CT_Colonography_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1038", null); + public CqlValueSet Colonoscopy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1020", null); [CqlDeclaration("CT Colonography")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1038")] - public CqlValueSet CT_Colonography() => - __CT_Colonography.Value; - - private CqlValueSet Dementia_Medications_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510", null); + public CqlValueSet CT_Colonography(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1038", null); [CqlDeclaration("Dementia Medications")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510")] - public CqlValueSet Dementia_Medications() => - __Dementia_Medications.Value; - - private CqlValueSet Discharged_to_Health_Care_Facility_for_Hospice_Care_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207", null); + public CqlValueSet Dementia_Medications(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510", null); [CqlDeclaration("Discharged to Health Care Facility for Hospice Care")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207")] - public CqlValueSet Discharged_to_Health_Care_Facility_for_Hospice_Care() => - __Discharged_to_Health_Care_Facility_for_Hospice_Care.Value; - - private CqlValueSet Discharged_to_Home_for_Hospice_Care_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209", null); + public CqlValueSet Discharged_to_Health_Care_Facility_for_Hospice_Care(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207", null); [CqlDeclaration("Discharged to Home for Hospice Care")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209")] - public CqlValueSet Discharged_to_Home_for_Hospice_Care() => - __Discharged_to_Home_for_Hospice_Care.Value; - - private CqlValueSet Encounter_Inpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307", null); + public CqlValueSet Discharged_to_Home_for_Hospice_Care(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209", null); [CqlDeclaration("Encounter Inpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307")] - public CqlValueSet Encounter_Inpatient() => - __Encounter_Inpatient.Value; - - private CqlValueSet Fecal_Occult_Blood_Test__FOBT__Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1011", null); + public CqlValueSet Encounter_Inpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307", null); [CqlDeclaration("Fecal Occult Blood Test (FOBT)")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1011")] - public CqlValueSet Fecal_Occult_Blood_Test__FOBT_() => - __Fecal_Occult_Blood_Test__FOBT_.Value; - - private CqlValueSet FIT_DNA_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1039", null); + public CqlValueSet Fecal_Occult_Blood_Test__FOBT_(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1011", null); [CqlDeclaration("FIT DNA")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1039")] - public CqlValueSet FIT_DNA() => - __FIT_DNA.Value; - - private CqlValueSet Flexible_Sigmoidoscopy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1010", null); + public CqlValueSet FIT_DNA(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1039", null); [CqlDeclaration("Flexible Sigmoidoscopy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1010")] - public CqlValueSet Flexible_Sigmoidoscopy() => - __Flexible_Sigmoidoscopy.Value; - - private CqlValueSet Frailty_Device_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300", null); + public CqlValueSet Flexible_Sigmoidoscopy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1010", null); [CqlDeclaration("Frailty Device")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300")] - public CqlValueSet Frailty_Device() => - __Frailty_Device.Value; - - private CqlValueSet Frailty_Diagnosis_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074", null); + public CqlValueSet Frailty_Device(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300", null); [CqlDeclaration("Frailty Diagnosis")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074")] - public CqlValueSet Frailty_Diagnosis() => - __Frailty_Diagnosis.Value; - - private CqlValueSet Frailty_Encounter_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088", null); + public CqlValueSet Frailty_Diagnosis(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074", null); [CqlDeclaration("Frailty Encounter")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088")] - public CqlValueSet Frailty_Encounter() => - __Frailty_Encounter.Value; - - private CqlValueSet Frailty_Symptom_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075", null); + public CqlValueSet Frailty_Encounter(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088", null); [CqlDeclaration("Frailty Symptom")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075")] - public CqlValueSet Frailty_Symptom() => - __Frailty_Symptom.Value; - - private CqlValueSet Home_Healthcare_Services_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016", null); + public CqlValueSet Frailty_Symptom(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075", null); [CqlDeclaration("Home Healthcare Services")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016")] - public CqlValueSet Home_Healthcare_Services() => - __Home_Healthcare_Services.Value; - - private CqlValueSet Hospice_care_ambulatory_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15", null); + public CqlValueSet Home_Healthcare_Services(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016", null); [CqlDeclaration("Hospice care ambulatory")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15")] - public CqlValueSet Hospice_care_ambulatory() => - __Hospice_care_ambulatory.Value; - - private CqlValueSet Malignant_Neoplasm_of_Colon_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1001", null); + public CqlValueSet Hospice_care_ambulatory(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1108.15", null); [CqlDeclaration("Malignant Neoplasm of Colon")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1001")] - public CqlValueSet Malignant_Neoplasm_of_Colon() => - __Malignant_Neoplasm_of_Colon.Value; - - private CqlValueSet Nonacute_Inpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084", null); + public CqlValueSet Malignant_Neoplasm_of_Colon(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1001", null); [CqlDeclaration("Nonacute Inpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084")] - public CqlValueSet Nonacute_Inpatient() => - __Nonacute_Inpatient.Value; - - private CqlValueSet Nursing_Facility_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012", null); + public CqlValueSet Nonacute_Inpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084", null); [CqlDeclaration("Nursing Facility Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012")] - public CqlValueSet Nursing_Facility_Visit() => - __Nursing_Facility_Visit.Value; - - private CqlValueSet Observation_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086", null); + public CqlValueSet Nursing_Facility_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012", null); [CqlDeclaration("Observation")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086")] - public CqlValueSet Observation() => - __Observation.Value; - - private CqlValueSet Office_Visit_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001", null); + public CqlValueSet Observation(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086", null); [CqlDeclaration("Office Visit")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001")] - public CqlValueSet Office_Visit() => - __Office_Visit.Value; - - private CqlValueSet Online_Assessments_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089", null); + public CqlValueSet Office_Visit(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001", null); [CqlDeclaration("Online Assessments")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089")] - public CqlValueSet Online_Assessments() => - __Online_Assessments.Value; - - private CqlValueSet Outpatient_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087", null); + public CqlValueSet Online_Assessments(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1089", null); [CqlDeclaration("Outpatient")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087")] - public CqlValueSet Outpatient() => - __Outpatient.Value; - - private CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025", null); + public CqlValueSet Outpatient(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087", null); [CqlDeclaration("Preventive Care Services - Established Office Visit, 18 and Up")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025")] - public CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up() => - __Preventive_Care_Services___Established_Office_Visit__18_and_Up.Value; - - private CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023", null); + public CqlValueSet Preventive_Care_Services___Established_Office_Visit__18_and_Up(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025", null); [CqlDeclaration("Preventive Care Services-Initial Office Visit, 18 and Up")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023")] - public CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up() => - __Preventive_Care_Services_Initial_Office_Visit__18_and_Up.Value; - - private CqlValueSet Telephone_Visits_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080", null); + public CqlValueSet Preventive_Care_Services_Initial_Office_Visit__18_and_Up(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023", null); [CqlDeclaration("Telephone Visits")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080")] - public CqlValueSet Telephone_Visits() => - __Telephone_Visits.Value; - - private CqlValueSet Total_Colectomy_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1019", null); + public CqlValueSet Telephone_Visits(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080", null); [CqlDeclaration("Total Colectomy")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1019")] - public CqlValueSet Total_Colectomy() => - __Total_Colectomy.Value; - - private CqlValueSet Total_Colectomy_ICD9_Value() => - new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.11.1136", null); + public CqlValueSet Total_Colectomy(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1019", null); [CqlDeclaration("Total Colectomy ICD9")] [CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.11.1136")] - public CqlValueSet Total_Colectomy_ICD9() => - __Total_Colectomy_ICD9.Value; - - private CqlCode laboratory_Value() => - new CqlCode("laboratory", "http://terminology.hl7.org/CodeSystem/observation-category", null, null); + public CqlValueSet Total_Colectomy_ICD9(CqlContext context) => + new CqlValueSet("http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.11.1136", null); [CqlDeclaration("laboratory")] - public CqlCode laboratory() => - __laboratory.Value; + public CqlCode laboratory(CqlContext context) => + new CqlCode("laboratory", "http://terminology.hl7.org/CodeSystem/observation-category", null, null); - private CqlCode[] ObservationCategoryCodes_Value() + [CqlDeclaration("ObservationCategoryCodes")] + public CqlCode[] ObservationCategoryCodes(CqlContext context) { var a_ = new CqlCode[] { @@ -449,11 +186,8 @@ private CqlCode[] ObservationCategoryCodes_Value() return a_; } - [CqlDeclaration("ObservationCategoryCodes")] - public CqlCode[] ObservationCategoryCodes() => - __ObservationCategoryCodes.Value; - - private CqlInterval Measurement_Period_Value() + [CqlDeclaration("Measurement Period")] + public CqlInterval Measurement_Period(CqlContext context) { var a_ = context.Operators.ConvertIntegerToDecimal(default); var b_ = context.Operators.DateTime((int?)2021, (int?)1, (int?)1, (int?)0, (int?)0, (int?)0, (int?)0, a_); @@ -464,11 +198,8 @@ private CqlInterval Measurement_Period_Value() return (CqlInterval)f_; } - [CqlDeclaration("Measurement Period")] - public CqlInterval Measurement_Period() => - __Measurement_Period.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -476,67 +207,52 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - - private IEnumerable SDE_Ethnicity_Value() - { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Ethnicity(); - - return a_; - } - [CqlDeclaration("SDE Ethnicity")] - public IEnumerable SDE_Ethnicity() => - __SDE_Ethnicity.Value; - - private IEnumerable SDE_Payer_Value() + public IEnumerable SDE_Ethnicity(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Payer(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Ethnicity(context); return a_; } [CqlDeclaration("SDE Payer")] - public IEnumerable SDE_Payer() => - __SDE_Payer.Value; - - private IEnumerable SDE_Race_Value() + public IEnumerable SDE_Payer(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Race(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Payer(context); return a_; } [CqlDeclaration("SDE Race")] - public IEnumerable SDE_Race() => - __SDE_Race.Value; - - private CqlCode SDE_Sex_Value() + public IEnumerable SDE_Race(CqlContext context) { - var a_ = SupplementalDataElementsFHIR4_2_0_000.SDE_Sex(); + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Race(context); return a_; } [CqlDeclaration("SDE Sex")] - public CqlCode SDE_Sex() => - __SDE_Sex.Value; + public CqlCode SDE_Sex(CqlContext context) + { + var a_ = SupplementalDataElementsFHIR4_2_0_000.Instance.SDE_Sex(context); + + return a_; + } - private IEnumerable Telehealth_Services_Value() + [CqlDeclaration("Telehealth Services")] + public IEnumerable Telehealth_Services(CqlContext context) { - var a_ = this.Online_Assessments(); + var a_ = this.Online_Assessments(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); - var c_ = this.Telephone_Visits(); + var c_ = this.Telephone_Visits(context); var d_ = context.Operators.RetrieveByValueSet(c_, null); var e_ = context.Operators.ListUnion(b_, d_); bool? f_(Encounter TelehealthEncounter) { var h_ = context.Operators.Convert(TelehealthEncounter?.StatusElement); var i_ = context.Operators.Equal(h_, "finished"); - var j_ = this.Measurement_Period(); - var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval((TelehealthEncounter?.Period as object)); + var j_ = this.Measurement_Period(context); + var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, (TelehealthEncounter?.Period as object)); var l_ = context.Operators.IntervalIncludesInterval(j_, k_, null); var m_ = context.Operators.And(i_, l_); @@ -547,15 +263,12 @@ private IEnumerable Telehealth_Services_Value() return g_; } - [CqlDeclaration("Telehealth Services")] - public IEnumerable Telehealth_Services() => - __Telehealth_Services.Value; - - private int? Age_at_start_of_Measurement_Period_Value() + [CqlDeclaration("Age at start of Measurement Period")] + public int? Age_at_start_of_Measurement_Period(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); @@ -563,22 +276,19 @@ public IEnumerable Telehealth_Services() => return f_; } - [CqlDeclaration("Age at start of Measurement Period")] - public int? Age_at_start_of_Measurement_Period() => - __Age_at_start_of_Measurement_Period.Value; - - private bool? Initial_Population_Value() + [CqlDeclaration("Initial Population")] + public bool? Initial_Population(CqlContext context) { - var a_ = this.Patient(); + var a_ = this.Patient(context); var b_ = context.Operators.Convert(a_?.BirthDateElement?.Value); - var c_ = this.Measurement_Period(); + var c_ = this.Measurement_Period(context); var d_ = context.Operators.Start(c_); var e_ = context.Operators.DateFrom(d_); var f_ = context.Operators.CalculateAgeAt(b_, e_, "year"); var g_ = context.Operators.Interval((int?)51, (int?)75, true, false); var h_ = context.Operators.ElementInInterval(f_, g_, null); - var i_ = AdultOutpatientEncountersFHIR4_2_2_000.Qualifying_Encounters(); - var j_ = this.Telehealth_Services(); + var i_ = AdultOutpatientEncountersFHIR4_2_2_000.Instance.Qualifying_Encounters(context); + var j_ = this.Telehealth_Services(context); var k_ = context.Operators.ListUnion(i_, j_); var l_ = context.Operators.ExistsInList(k_); var m_ = context.Operators.And(h_, l_); @@ -586,30 +296,24 @@ public IEnumerable Telehealth_Services() => return m_; } - [CqlDeclaration("Initial Population")] - public bool? Initial_Population() => - __Initial_Population.Value; - - private bool? Denominator_Value() + [CqlDeclaration("Denominator")] + public bool? Denominator(CqlContext context) { - var a_ = this.Initial_Population(); + var a_ = this.Initial_Population(context); return a_; } - [CqlDeclaration("Denominator")] - public bool? Denominator() => - __Denominator.Value; - - private IEnumerable Malignant_Neoplasm_Value() + [CqlDeclaration("Malignant Neoplasm")] + public IEnumerable Malignant_Neoplasm(CqlContext context) { - var a_ = this.Malignant_Neoplasm_of_Colon(); + var a_ = this.Malignant_Neoplasm_of_Colon(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Condition ColorectalCancer) { - var e_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(ColorectalCancer); + var e_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, ColorectalCancer); var f_ = context.Operators.Start(e_); - var g_ = this.Measurement_Period(); + var g_ = this.Measurement_Period(context); var h_ = context.Operators.End(g_); var i_ = context.Operators.SameOrBefore(f_, h_, null); @@ -620,21 +324,18 @@ private IEnumerable Malignant_Neoplasm_Value() return d_; } - [CqlDeclaration("Malignant Neoplasm")] - public IEnumerable Malignant_Neoplasm() => - __Malignant_Neoplasm.Value; - - private IEnumerable Total_Colectomy_Performed_Value() + [CqlDeclaration("Total Colectomy Performed")] + public IEnumerable Total_Colectomy_Performed(CqlContext context) { - var a_ = this.Total_Colectomy(); + var a_ = this.Total_Colectomy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure Colectomy) { var e_ = context.Operators.Convert(Colectomy?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colectomy?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colectomy?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.SameOrBefore(h_, j_, null); var l_ = context.Operators.And(f_, k_); @@ -646,19 +347,16 @@ private IEnumerable Total_Colectomy_Performed_Value() return d_; } - [CqlDeclaration("Total Colectomy Performed")] - public IEnumerable Total_Colectomy_Performed() => - __Total_Colectomy_Performed.Value; - - private IEnumerable Total_Colectomy_Condition_Value() + [CqlDeclaration("Total Colectomy Condition")] + public IEnumerable Total_Colectomy_Condition(CqlContext context) { - var a_ = this.Total_Colectomy_ICD9(); + var a_ = this.Total_Colectomy_ICD9(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Condition ColectomyDx) { - var e_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Prevalence_Period(ColectomyDx); + var e_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Prevalence_Period(context, ColectomyDx); var f_ = context.Operators.Start(e_); - var g_ = this.Measurement_Period(); + var g_ = this.Measurement_Period(context); var h_ = context.Operators.End(g_); var i_ = context.Operators.SameOrBefore(f_, h_, null); @@ -669,52 +367,46 @@ private IEnumerable Total_Colectomy_Condition_Value() return d_; } - [CqlDeclaration("Total Colectomy Condition")] - public IEnumerable Total_Colectomy_Condition() => - __Total_Colectomy_Condition.Value; - - private bool? Denominator_Exclusions_Value() + [CqlDeclaration("Denominator Exclusions")] + public bool? Denominator_Exclusions(CqlContext context) { - var a_ = HospiceFHIR4_2_3_000.Has_Hospice(); - var b_ = this.Malignant_Neoplasm(); + var a_ = HospiceFHIR4_2_3_000.Instance.Has_Hospice(context); + var b_ = this.Malignant_Neoplasm(context); var c_ = context.Operators.ExistsInList(b_); var d_ = context.Operators.Or(a_, c_); - var e_ = this.Total_Colectomy_Performed(); + var e_ = this.Total_Colectomy_Performed(context); var f_ = context.Operators.ExistsInList(e_); var g_ = context.Operators.Or(d_, f_); - var h_ = this.Total_Colectomy_Condition(); + var h_ = this.Total_Colectomy_Condition(context); var i_ = context.Operators.ExistsInList(h_); var j_ = context.Operators.Or(g_, i_); - var k_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(); + var k_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Instance.Advanced_Illness_and_Frailty_Exclusion_Not_Including_Over_Age_80(context); var l_ = context.Operators.Or(j_, k_); - var m_ = this.Patient(); + var m_ = this.Patient(context); var n_ = context.Operators.Convert(m_?.BirthDateElement?.Value); - var o_ = this.Measurement_Period(); + var o_ = this.Measurement_Period(context); var p_ = context.Operators.Start(o_); var q_ = context.Operators.DateFrom(p_); var r_ = context.Operators.CalculateAgeAt(n_, q_, "year"); var s_ = context.Operators.GreaterOrEqual(r_, (int?)65); - var t_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days(); + var t_ = AdvancedIllnessandFrailtyExclusionECQMFHIR4_5_17_000.Instance.Has_Long_Term_Care_Periods_Longer_Than_90_Consecutive_Days(context); var u_ = context.Operators.And(s_, t_); var v_ = context.Operators.Or(l_, u_); - var w_ = PalliativeCareFHIR_0_6_000.Palliative_Care_in_the_Measurement_Period(); + var w_ = PalliativeCareFHIR_0_6_000.Instance.Palliative_Care_in_the_Measurement_Period(context); var x_ = context.Operators.Or(v_, w_); return x_; } - [CqlDeclaration("Denominator Exclusions")] - public bool? Denominator_Exclusions() => - __Denominator_Exclusions.Value; - - private IEnumerable Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status_Value() + [CqlDeclaration("Fecal Occult Blood Test Display Date, Result, Category, Status")] + public IEnumerable Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status(CqlContext context) { - var a_ = this.Fecal_Occult_Blood_Test__FOBT_(); + var a_ = this.Fecal_Occult_Blood_Test__FOBT_(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FecalOccult) { - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FecalOccult?.Effective); - var h_ = this.Measurement_Period(); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FecalOccult?.Effective); + var h_ = this.Measurement_Period(context); var i_ = context.Operators.Start(h_); var j_ = context.Operators.Quantity(1m, "year"); var k_ = context.Operators.Subtract(i_, j_); @@ -727,7 +419,7 @@ public IEnumerable Total_Colectomy_Condition() => var d_ = context.Operators.WhereOrNull(b_, c_); Tuples.Tuple_GHYDcaRJOeEdWbTSSCjjBhBFW e_(Observation FecalOccult) { - var p_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FecalOccult?.Effective); + var p_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FecalOccult?.Effective); var q_ = context.Operators.LateBoundProperty>(FecalOccult?.Value, "coding"); bool? r_(Coding @this) { @@ -785,13 +477,10 @@ string ag_(Code @this) => return f_; } - [CqlDeclaration("Fecal Occult Blood Test Display Date, Result, Category, Status")] - public IEnumerable Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status() => - __Fecal_Occult_Blood_Test_Display_Date__Result__Category__Status.Value; - - private IEnumerable Fecal_Occult_Blood_Test_Performed_Value() + [CqlDeclaration("Fecal Occult Blood Test Performed")] + public IEnumerable Fecal_Occult_Blood_Test_Performed(CqlContext context) { - var a_ = this.Fecal_Occult_Blood_Test__FOBT_(); + var a_ = this.Fecal_Occult_Blood_Test__FOBT_(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FecalOccult) { @@ -838,8 +527,8 @@ string x_(Code @this) => var k_ = context.Operators.And(g_, j_); var l_ = context.Operators.Not((bool?)(FecalOccult?.Value is null)); var m_ = context.Operators.And(k_, l_); - var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FecalOccult?.Effective); - var o_ = this.Measurement_Period(); + var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FecalOccult?.Effective); + var o_ = this.Measurement_Period(context); var p_ = context.Operators.ElementInInterval(n_, o_, null); var q_ = context.Operators.And(m_, p_); @@ -850,13 +539,10 @@ string x_(Code @this) => return d_; } - [CqlDeclaration("Fecal Occult Blood Test Performed")] - public IEnumerable Fecal_Occult_Blood_Test_Performed() => - __Fecal_Occult_Blood_Test_Performed.Value; - - private IEnumerable Fecal_Occult_Blood_Test_Performed__day_of_TZoffset_Value() + [CqlDeclaration("Fecal Occult Blood Test Performed, day of TZoffset")] + public IEnumerable Fecal_Occult_Blood_Test_Performed__day_of_TZoffset(CqlContext context) { - var a_ = this.Fecal_Occult_Blood_Test__FOBT_(); + var a_ = this.Fecal_Occult_Blood_Test__FOBT_(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FecalOccult) { @@ -903,8 +589,8 @@ string x_(Code @this) => var k_ = context.Operators.And(g_, j_); var l_ = context.Operators.Not((bool?)(FecalOccult?.Value is null)); var m_ = context.Operators.And(k_, l_); - var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FecalOccult?.Effective); - var o_ = this.Measurement_Period(); + var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FecalOccult?.Effective); + var o_ = this.Measurement_Period(context); var p_ = context.Operators.ElementInInterval(n_, o_, "day"); var q_ = context.Operators.And(m_, p_); @@ -915,13 +601,10 @@ string x_(Code @this) => return d_; } - [CqlDeclaration("Fecal Occult Blood Test Performed, day of TZoffset")] - public IEnumerable Fecal_Occult_Blood_Test_Performed__day_of_TZoffset() => - __Fecal_Occult_Blood_Test_Performed__day_of_TZoffset.Value; - - private IEnumerable Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset_Value() + [CqlDeclaration("Fecal Occult Blood Test Performed without appropriate category, ignore status, day of TZoffset")] + public IEnumerable Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset(CqlContext context) { - var a_ = this.Fecal_Occult_Blood_Test__FOBT_(); + var a_ = this.Fecal_Occult_Blood_Test__FOBT_(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FecalOccult) { @@ -960,8 +643,8 @@ string t_(Code @this) => var g_ = context.Operators.ExistsInList(f_); var h_ = context.Operators.Not((bool?)(FecalOccult?.Value is null)); var i_ = context.Operators.And(g_, h_); - var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FecalOccult?.Effective); - var k_ = this.Measurement_Period(); + var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FecalOccult?.Effective); + var k_ = this.Measurement_Period(context); var l_ = context.Operators.ElementInInterval(j_, k_, "day"); var m_ = context.Operators.And(i_, l_); @@ -972,13 +655,10 @@ string t_(Code @this) => return d_; } - [CqlDeclaration("Fecal Occult Blood Test Performed without appropriate category, ignore status, day of TZoffset")] - public IEnumerable Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset() => - __Fecal_Occult_Blood_Test_Performed_without_appropriate_category__ignore_status__day_of_TZoffset.Value; - - private IEnumerable Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset_Value() + [CqlDeclaration("Fecal Occult Blood Test Performed without appropriate status, ignore category, day of TZoffset")] + public IEnumerable Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset(CqlContext context) { - var a_ = this.Fecal_Occult_Blood_Test__FOBT_(); + var a_ = this.Fecal_Occult_Blood_Test__FOBT_(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FecalOccult) { @@ -993,8 +673,8 @@ private IEnumerable Fecal_Occult_Blood_Test_Performed_without_appro var h_ = context.Operators.Not(g_); var i_ = context.Operators.Not((bool?)(FecalOccult?.Value is null)); var j_ = context.Operators.And(h_, i_); - var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FecalOccult?.Effective); - var l_ = this.Measurement_Period(); + var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FecalOccult?.Effective); + var l_ = this.Measurement_Period(context); var m_ = context.Operators.ElementInInterval(k_, l_, "day"); var n_ = context.Operators.And(j_, m_); @@ -1005,18 +685,15 @@ private IEnumerable Fecal_Occult_Blood_Test_Performed_without_appro return d_; } - [CqlDeclaration("Fecal Occult Blood Test Performed without appropriate status, ignore category, day of TZoffset")] - public IEnumerable Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset() => - __Fecal_Occult_Blood_Test_Performed_without_appropriate_status__ignore_category__day_of_TZoffset.Value; - - private IEnumerable Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status_Value() + [CqlDeclaration("Fecal Immunochemical Test DNA Display Date, Result, Category, Status")] + public IEnumerable Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status(CqlContext context) { - var a_ = this.FIT_DNA(); + var a_ = this.FIT_DNA(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FitDNA) { - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FitDNA?.Effective); - var h_ = this.Measurement_Period(); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FitDNA?.Effective); + var h_ = this.Measurement_Period(context); var i_ = context.Operators.End(h_); var j_ = context.Operators.Quantity(4m, "years"); var k_ = context.Operators.Subtract(i_, j_); @@ -1032,7 +709,7 @@ public IEnumerable Fecal_Occult_Blood_Test_Performed_without_approp var d_ = context.Operators.WhereOrNull(b_, c_); Tuples.Tuple_GHYDcaRJOeEdWbTSSCjjBhBFW e_(Observation FitDNA) { - var t_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FitDNA?.Effective); + var t_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FitDNA?.Effective); var u_ = context.Operators.LateBoundProperty>(FitDNA?.Value, "coding"); bool? v_(Coding @this) { @@ -1090,13 +767,10 @@ string ak_(Code @this) => return f_; } - [CqlDeclaration("Fecal Immunochemical Test DNA Display Date, Result, Category, Status")] - public IEnumerable Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status() => - __Fecal_Immunochemical_Test_DNA_Display_Date__Result__Category__Status.Value; - - private IEnumerable Fecal_Immunochemical_Test_DNA_Performed_Value() + [CqlDeclaration("Fecal Immunochemical Test DNA Performed")] + public IEnumerable Fecal_Immunochemical_Test_DNA_Performed(CqlContext context) { - var a_ = this.FIT_DNA(); + var a_ = this.FIT_DNA(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FitDNA) { @@ -1143,8 +817,8 @@ string ah_(Code @this) => var k_ = context.Operators.And(g_, j_); var l_ = context.Operators.Not((bool?)(FitDNA?.Value is null)); var m_ = context.Operators.And(k_, l_); - var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FitDNA?.Effective); - var o_ = this.Measurement_Period(); + var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FitDNA?.Effective); + var o_ = this.Measurement_Period(context); var p_ = context.Operators.End(o_); var q_ = context.Operators.Quantity(3m, "years"); var r_ = context.Operators.Subtract(p_, q_); @@ -1163,13 +837,10 @@ string ah_(Code @this) => return d_; } - [CqlDeclaration("Fecal Immunochemical Test DNA Performed")] - public IEnumerable Fecal_Immunochemical_Test_DNA_Performed() => - __Fecal_Immunochemical_Test_DNA_Performed.Value; - - private IEnumerable Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset_Value() + [CqlDeclaration("Fecal Immunochemical Test DNA Performed, day of TZoffset")] + public IEnumerable Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset(CqlContext context) { - var a_ = this.FIT_DNA(); + var a_ = this.FIT_DNA(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FitDNA) { @@ -1216,8 +887,8 @@ string ah_(Code @this) => var k_ = context.Operators.And(g_, j_); var l_ = context.Operators.Not((bool?)(FitDNA?.Value is null)); var m_ = context.Operators.And(k_, l_); - var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FitDNA?.Effective); - var o_ = this.Measurement_Period(); + var n_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FitDNA?.Effective); + var o_ = this.Measurement_Period(context); var p_ = context.Operators.End(o_); var q_ = context.Operators.Quantity(3m, "years"); var r_ = context.Operators.Subtract(p_, q_); @@ -1236,13 +907,10 @@ string ah_(Code @this) => return d_; } - [CqlDeclaration("Fecal Immunochemical Test DNA Performed, day of TZoffset")] - public IEnumerable Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset() => - __Fecal_Immunochemical_Test_DNA_Performed__day_of_TZoffset.Value; - - private IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset_Value() + [CqlDeclaration("Fecal Immunochemical Test DNA Performed without appropriate category, ignore status, day of TZoffset")] + public IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset(CqlContext context) { - var a_ = this.FIT_DNA(); + var a_ = this.FIT_DNA(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FitDNA) { @@ -1281,8 +949,8 @@ string ad_(Code @this) => var g_ = context.Operators.ExistsInList(f_); var h_ = context.Operators.Not((bool?)(FitDNA?.Value is null)); var i_ = context.Operators.And(g_, h_); - var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FitDNA?.Effective); - var k_ = this.Measurement_Period(); + var j_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FitDNA?.Effective); + var k_ = this.Measurement_Period(context); var l_ = context.Operators.End(k_); var m_ = context.Operators.Quantity(3m, "years"); var n_ = context.Operators.Subtract(l_, m_); @@ -1301,13 +969,10 @@ string ad_(Code @this) => return d_; } - [CqlDeclaration("Fecal Immunochemical Test DNA Performed without appropriate category, ignore status, day of TZoffset")] - public IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset() => - __Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_category__ignore_status__day_of_TZoffset.Value; - - private IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset_Value() + [CqlDeclaration("Fecal Immunochemical Test DNA Performed without appropriate status, ignore category, day of TZoffset")] + public IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset(CqlContext context) { - var a_ = this.FIT_DNA(); + var a_ = this.FIT_DNA(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation FitDNA) { @@ -1322,8 +987,8 @@ private IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without var h_ = context.Operators.Not(g_); var i_ = context.Operators.Not((bool?)(FitDNA?.Value is null)); var j_ = context.Operators.And(h_, i_); - var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FitDNA?.Effective); - var l_ = this.Measurement_Period(); + var k_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FitDNA?.Effective); + var l_ = this.Measurement_Period(context); var m_ = context.Operators.End(l_); var n_ = context.Operators.Quantity(3m, "years"); var o_ = context.Operators.Subtract(m_, n_); @@ -1342,19 +1007,16 @@ private IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without return d_; } - [CqlDeclaration("Fecal Immunochemical Test DNA Performed without appropriate status, ignore category, day of TZoffset")] - public IEnumerable Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset() => - __Fecal_Immunochemical_Test_DNA_Performed_without_appropriate_status__ignore_category__day_of_TZoffset.Value; - - private IEnumerable CT_Colonography_Display_Date_Value() + [CqlDeclaration("CT Colonography Display Date")] + public IEnumerable CT_Colonography_Display_Date(CqlContext context) { - var a_ = this.CT_Colonography(); + var a_ = this.CT_Colonography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation Colonography) { - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colonography?.Effective); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colonography?.Effective); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.Quantity(6m, "years"); var l_ = context.Operators.Subtract(j_, k_); @@ -1370,7 +1032,7 @@ private IEnumerable CT_Colonography_Display_Date_Value() var d_ = context.Operators.WhereOrNull(b_, c_); CqlDateTime e_(Observation Colonography) { - var u_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(Colonography?.Effective); + var u_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, Colonography?.Effective); return u_; }; @@ -1379,13 +1041,10 @@ CqlDateTime e_(Observation Colonography) return f_; } - [CqlDeclaration("CT Colonography Display Date")] - public IEnumerable CT_Colonography_Display_Date() => - __CT_Colonography_Display_Date.Value; - - private IEnumerable CT_Colonography_Performed_Value() + [CqlDeclaration("CT Colonography Performed")] + public IEnumerable CT_Colonography_Performed(CqlContext context) { - var a_ = this.CT_Colonography(); + var a_ = this.CT_Colonography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation Colonography) { @@ -1398,9 +1057,9 @@ private IEnumerable CT_Colonography_Performed_Value() "appended", }; var g_ = context.Operators.InList(e_, (f_ as IEnumerable)); - var h_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colonography?.Effective); + var h_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colonography?.Effective); var i_ = context.Operators.End(h_); - var j_ = this.Measurement_Period(); + var j_ = this.Measurement_Period(context); var k_ = context.Operators.End(j_); var l_ = context.Operators.Quantity(5m, "years"); var m_ = context.Operators.Subtract(k_, l_); @@ -1419,13 +1078,10 @@ private IEnumerable CT_Colonography_Performed_Value() return d_; } - [CqlDeclaration("CT Colonography Performed")] - public IEnumerable CT_Colonography_Performed() => - __CT_Colonography_Performed.Value; - - private IEnumerable CT_Colonography_Performed_without_appropriate_status_Value() + [CqlDeclaration("CT Colonography Performed without appropriate status")] + public IEnumerable CT_Colonography_Performed_without_appropriate_status(CqlContext context) { - var a_ = this.CT_Colonography(); + var a_ = this.CT_Colonography(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Observation Colonography) { @@ -1439,9 +1095,9 @@ private IEnumerable CT_Colonography_Performed_without_appropriate_s }; var g_ = context.Operators.InList(e_, (f_ as IEnumerable)); var h_ = context.Operators.Not(g_); - var i_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colonography?.Effective); + var i_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colonography?.Effective); var j_ = context.Operators.End(i_); - var k_ = this.Measurement_Period(); + var k_ = this.Measurement_Period(context); var l_ = context.Operators.End(k_); var m_ = context.Operators.Quantity(5m, "years"); var n_ = context.Operators.Subtract(l_, m_); @@ -1460,19 +1116,16 @@ private IEnumerable CT_Colonography_Performed_without_appropriate_s return d_; } - [CqlDeclaration("CT Colonography Performed without appropriate status")] - public IEnumerable CT_Colonography_Performed_without_appropriate_status() => - __CT_Colonography_Performed_without_appropriate_status.Value; - - private IEnumerable Flexible_Sigmoidoscopy_Display_Date_Value() + [CqlDeclaration("Flexible Sigmoidoscopy Display Date")] + public IEnumerable Flexible_Sigmoidoscopy_Display_Date(CqlContext context) { - var a_ = this.Flexible_Sigmoidoscopy(); + var a_ = this.Flexible_Sigmoidoscopy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure FlexibleSigmoidoscopy) { - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(FlexibleSigmoidoscopy?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, FlexibleSigmoidoscopy?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.Quantity(6m, "years"); var l_ = context.Operators.Subtract(j_, k_); @@ -1488,7 +1141,7 @@ private IEnumerable Flexible_Sigmoidoscopy_Display_Date_Value() var d_ = context.Operators.WhereOrNull(b_, c_); CqlDateTime e_(Procedure FlexibleSigmoidoscopy) { - var u_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(FlexibleSigmoidoscopy?.Performed); + var u_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, FlexibleSigmoidoscopy?.Performed); return u_; }; @@ -1497,21 +1150,18 @@ CqlDateTime e_(Procedure FlexibleSigmoidoscopy) return f_; } - [CqlDeclaration("Flexible Sigmoidoscopy Display Date")] - public IEnumerable Flexible_Sigmoidoscopy_Display_Date() => - __Flexible_Sigmoidoscopy_Display_Date.Value; - - private IEnumerable Flexible_Sigmoidoscopy_Performed_Value() + [CqlDeclaration("Flexible Sigmoidoscopy Performed")] + public IEnumerable Flexible_Sigmoidoscopy_Performed(CqlContext context) { - var a_ = this.Flexible_Sigmoidoscopy(); + var a_ = this.Flexible_Sigmoidoscopy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure FlexibleSigmoidoscopy) { var e_ = context.Operators.Convert(FlexibleSigmoidoscopy?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(FlexibleSigmoidoscopy?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, FlexibleSigmoidoscopy?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.Quantity(5m, "years"); var l_ = context.Operators.Subtract(j_, k_); @@ -1530,22 +1180,19 @@ private IEnumerable Flexible_Sigmoidoscopy_Performed_Value() return d_; } - [CqlDeclaration("Flexible Sigmoidoscopy Performed")] - public IEnumerable Flexible_Sigmoidoscopy_Performed() => - __Flexible_Sigmoidoscopy_Performed.Value; - - private IEnumerable Flexible_Sigmoidoscopy_Performed_without_appropriate_status_Value() + [CqlDeclaration("Flexible Sigmoidoscopy Performed without appropriate status")] + public IEnumerable Flexible_Sigmoidoscopy_Performed_without_appropriate_status(CqlContext context) { - var a_ = this.Flexible_Sigmoidoscopy(); + var a_ = this.Flexible_Sigmoidoscopy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure FlexibleSigmoidoscopy) { var e_ = context.Operators.Convert(FlexibleSigmoidoscopy?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); var g_ = context.Operators.Not(f_); - var h_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(FlexibleSigmoidoscopy?.Performed); + var h_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, FlexibleSigmoidoscopy?.Performed); var i_ = context.Operators.End(h_); - var j_ = this.Measurement_Period(); + var j_ = this.Measurement_Period(context); var k_ = context.Operators.End(j_); var l_ = context.Operators.Quantity(5m, "years"); var m_ = context.Operators.Subtract(k_, l_); @@ -1564,19 +1211,16 @@ private IEnumerable Flexible_Sigmoidoscopy_Performed_without_appropri return d_; } - [CqlDeclaration("Flexible Sigmoidoscopy Performed without appropriate status")] - public IEnumerable Flexible_Sigmoidoscopy_Performed_without_appropriate_status() => - __Flexible_Sigmoidoscopy_Performed_without_appropriate_status.Value; - - private IEnumerable Colonoscopy_Display_Date_Value() + [CqlDeclaration("Colonoscopy Display Date")] + public IEnumerable Colonoscopy_Display_Date(CqlContext context) { - var a_ = this.Colonoscopy(); + var a_ = this.Colonoscopy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure Colonoscopy) { - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colonoscopy?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colonoscopy?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.Quantity(11m, "years"); var l_ = context.Operators.Subtract(j_, k_); @@ -1592,7 +1236,7 @@ private IEnumerable Colonoscopy_Display_Date_Value() var d_ = context.Operators.WhereOrNull(b_, c_); CqlDateTime e_(Procedure Colonoscopy) { - var u_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Latest(Colonoscopy?.Performed); + var u_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Latest(context, Colonoscopy?.Performed); return u_; }; @@ -1601,21 +1245,18 @@ CqlDateTime e_(Procedure Colonoscopy) return f_; } - [CqlDeclaration("Colonoscopy Display Date")] - public IEnumerable Colonoscopy_Display_Date() => - __Colonoscopy_Display_Date.Value; - - private IEnumerable Colonoscopy_Performed_Value() + [CqlDeclaration("Colonoscopy Performed")] + public IEnumerable Colonoscopy_Performed(CqlContext context) { - var a_ = this.Colonoscopy(); + var a_ = this.Colonoscopy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure Colonoscopy) { var e_ = context.Operators.Convert(Colonoscopy?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); - var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colonoscopy?.Performed); + var g_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colonoscopy?.Performed); var h_ = context.Operators.End(g_); - var i_ = this.Measurement_Period(); + var i_ = this.Measurement_Period(context); var j_ = context.Operators.End(i_); var k_ = context.Operators.Quantity(10m, "years"); var l_ = context.Operators.Subtract(j_, k_); @@ -1634,22 +1275,19 @@ private IEnumerable Colonoscopy_Performed_Value() return d_; } - [CqlDeclaration("Colonoscopy Performed")] - public IEnumerable Colonoscopy_Performed() => - __Colonoscopy_Performed.Value; - - private IEnumerable Colonoscopy_Performed_without_appropriate_status_Value() + [CqlDeclaration("Colonoscopy Performed without appropriate status")] + public IEnumerable Colonoscopy_Performed_without_appropriate_status(CqlContext context) { - var a_ = this.Colonoscopy(); + var a_ = this.Colonoscopy(context); var b_ = context.Operators.RetrieveByValueSet(a_, null); bool? c_(Procedure Colonoscopy) { var e_ = context.Operators.Convert(Colonoscopy?.StatusElement); var f_ = context.Operators.Equal(e_, "completed"); var g_ = context.Operators.Not(f_); - var h_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Normalize_Interval(Colonoscopy?.Performed); + var h_ = MATGlobalCommonFunctionsFHIR4_6_1_000.Instance.Normalize_Interval(context, Colonoscopy?.Performed); var i_ = context.Operators.End(h_); - var j_ = this.Measurement_Period(); + var j_ = this.Measurement_Period(context); var k_ = context.Operators.End(j_); var l_ = context.Operators.Quantity(10m, "years"); var m_ = context.Operators.Subtract(k_, l_); @@ -1668,50 +1306,40 @@ private IEnumerable Colonoscopy_Performed_without_appropriate_status_ return d_; } - [CqlDeclaration("Colonoscopy Performed without appropriate status")] - public IEnumerable Colonoscopy_Performed_without_appropriate_status() => - __Colonoscopy_Performed_without_appropriate_status.Value; - - private bool? Numerator_Value() + [CqlDeclaration("Numerator")] + public bool? Numerator(CqlContext context) { - var a_ = this.Colonoscopy_Performed(); + var a_ = this.Colonoscopy_Performed(context); var b_ = context.Operators.ExistsInList(a_); - var c_ = this.Fecal_Occult_Blood_Test_Performed(); + var c_ = this.Fecal_Occult_Blood_Test_Performed(context); var d_ = context.Operators.ExistsInList(c_); var e_ = context.Operators.Or(b_, d_); - var f_ = this.Flexible_Sigmoidoscopy_Performed(); + var f_ = this.Flexible_Sigmoidoscopy_Performed(context); var g_ = context.Operators.ExistsInList(f_); var h_ = context.Operators.Or(e_, g_); - var i_ = this.Fecal_Immunochemical_Test_DNA_Performed(); + var i_ = this.Fecal_Immunochemical_Test_DNA_Performed(context); var j_ = context.Operators.ExistsInList(i_); var k_ = context.Operators.Or(h_, j_); - var l_ = this.CT_Colonography_Performed(); + var l_ = this.CT_Colonography_Performed(context); var m_ = context.Operators.ExistsInList(l_); var n_ = context.Operators.Or(k_, m_); return n_; } - [CqlDeclaration("Numerator")] - public bool? Numerator() => - __Numerator.Value; - - private bool? Final_Numerator_Population_Value() + [CqlDeclaration("Final Numerator Population")] + public bool? Final_Numerator_Population(CqlContext context) { - var a_ = this.Numerator(); - var b_ = this.Initial_Population(); + var a_ = this.Numerator(context); + var b_ = this.Initial_Population(context); var c_ = context.Operators.And(a_, b_); - var d_ = this.Denominator(); + var d_ = this.Denominator(context); var e_ = context.Operators.And(c_, d_); - var f_ = this.Denominator_Exclusions(); + var f_ = this.Denominator_Exclusions(context); var g_ = context.Operators.Not(f_); var h_ = context.Operators.And(e_, g_); return h_; } - [CqlDeclaration("Final Numerator Population")] - public bool? Final_Numerator_Population() => - __Final_Numerator_Population.Value; - } \ No newline at end of file diff --git a/Demo/Measures/CumulativeMedicationDurationFHIR4-1.0.000.cs b/Demo/Measures/CumulativeMedicationDurationFHIR4-1.0.000.cs index b9ef15685..375c22001 100644 --- a/Demo/Measures/CumulativeMedicationDurationFHIR4-1.0.000.cs +++ b/Demo/Measures/CumulativeMedicationDurationFHIR4-1.0.000.cs @@ -14,269 +14,114 @@ public class CumulativeMedicationDurationFHIR4_1_0_000 { - - internal CqlContext context; - - #region Cached values - - internal Lazy __AC; - internal Lazy __ACD; - internal Lazy __ACM; - internal Lazy __ACV; - internal Lazy __AFT; - internal Lazy __AFT_early; - internal Lazy __AFT_late; - internal Lazy __C; - internal Lazy __CD; - internal Lazy __CM; - internal Lazy __CV; - internal Lazy __EVE; - internal Lazy __EVE_early; - internal Lazy __EVE_late; - internal Lazy __HS; - internal Lazy __MORN; - internal Lazy __MORN_early; - internal Lazy __MORN_late; - internal Lazy __NIGHT; - internal Lazy __NOON; - internal Lazy __PC; - internal Lazy __PCD; - internal Lazy __PCM; - internal Lazy __PCV; - internal Lazy __PHS; - internal Lazy __WAKE; - internal Lazy __V3TimingEvent; - internal Lazy __EventTiming; - internal Lazy __ErrorLevel; - internal Lazy __Patient; - - #endregion - public CumulativeMedicationDurationFHIR4_1_0_000(CqlContext context) - { - this.context = context ?? throw new ArgumentNullException("context"); - - FHIRHelpers_4_0_001 = new FHIRHelpers_4_0_001(context); - - __AC = new Lazy(this.AC_Value); - __ACD = new Lazy(this.ACD_Value); - __ACM = new Lazy(this.ACM_Value); - __ACV = new Lazy(this.ACV_Value); - __AFT = new Lazy(this.AFT_Value); - __AFT_early = new Lazy(this.AFT_early_Value); - __AFT_late = new Lazy(this.AFT_late_Value); - __C = new Lazy(this.C_Value); - __CD = new Lazy(this.CD_Value); - __CM = new Lazy(this.CM_Value); - __CV = new Lazy(this.CV_Value); - __EVE = new Lazy(this.EVE_Value); - __EVE_early = new Lazy(this.EVE_early_Value); - __EVE_late = new Lazy(this.EVE_late_Value); - __HS = new Lazy(this.HS_Value); - __MORN = new Lazy(this.MORN_Value); - __MORN_early = new Lazy(this.MORN_early_Value); - __MORN_late = new Lazy(this.MORN_late_Value); - __NIGHT = new Lazy(this.NIGHT_Value); - __NOON = new Lazy(this.NOON_Value); - __PC = new Lazy(this.PC_Value); - __PCD = new Lazy(this.PCD_Value); - __PCM = new Lazy(this.PCM_Value); - __PCV = new Lazy(this.PCV_Value); - __PHS = new Lazy(this.PHS_Value); - __WAKE = new Lazy(this.WAKE_Value); - __V3TimingEvent = new Lazy(this.V3TimingEvent_Value); - __EventTiming = new Lazy(this.EventTiming_Value); - __ErrorLevel = new Lazy(this.ErrorLevel_Value); - __Patient = new Lazy(this.Patient_Value); - } - #region Dependencies - - public FHIRHelpers_4_0_001 FHIRHelpers_4_0_001 { get; } - - #endregion - - private CqlCode AC_Value() => - new CqlCode("AC", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public static CumulativeMedicationDurationFHIR4_1_0_000 Instance { get; } = new(); [CqlDeclaration("AC")] - public CqlCode AC() => - __AC.Value; - - private CqlCode ACD_Value() => - new CqlCode("ACD", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode AC(CqlContext context) => + new CqlCode("AC", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("ACD")] - public CqlCode ACD() => - __ACD.Value; - - private CqlCode ACM_Value() => - new CqlCode("ACM", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode ACD(CqlContext context) => + new CqlCode("ACD", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("ACM")] - public CqlCode ACM() => - __ACM.Value; - - private CqlCode ACV_Value() => - new CqlCode("ACV", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode ACM(CqlContext context) => + new CqlCode("ACM", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("ACV")] - public CqlCode ACV() => - __ACV.Value; - - private CqlCode AFT_Value() => - new CqlCode("AFT", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode ACV(CqlContext context) => + new CqlCode("ACV", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("AFT")] - public CqlCode AFT() => - __AFT.Value; - - private CqlCode AFT_early_Value() => - new CqlCode("AFT.early", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode AFT(CqlContext context) => + new CqlCode("AFT", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("AFT.early")] - public CqlCode AFT_early() => - __AFT_early.Value; - - private CqlCode AFT_late_Value() => - new CqlCode("AFT.late", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode AFT_early(CqlContext context) => + new CqlCode("AFT.early", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("AFT.late")] - public CqlCode AFT_late() => - __AFT_late.Value; - - private CqlCode C_Value() => - new CqlCode("C", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode AFT_late(CqlContext context) => + new CqlCode("AFT.late", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("C")] - public CqlCode C() => - __C.Value; - - private CqlCode CD_Value() => - new CqlCode("CD", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode C(CqlContext context) => + new CqlCode("C", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("CD")] - public CqlCode CD() => - __CD.Value; - - private CqlCode CM_Value() => - new CqlCode("CM", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode CD(CqlContext context) => + new CqlCode("CD", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("CM")] - public CqlCode CM() => - __CM.Value; - - private CqlCode CV_Value() => - new CqlCode("CV", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode CM(CqlContext context) => + new CqlCode("CM", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("CV")] - public CqlCode CV() => - __CV.Value; - - private CqlCode EVE_Value() => - new CqlCode("EVE", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode CV(CqlContext context) => + new CqlCode("CV", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("EVE")] - public CqlCode EVE() => - __EVE.Value; - - private CqlCode EVE_early_Value() => - new CqlCode("EVE.early", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode EVE(CqlContext context) => + new CqlCode("EVE", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("EVE.early")] - public CqlCode EVE_early() => - __EVE_early.Value; - - private CqlCode EVE_late_Value() => - new CqlCode("EVE.late", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode EVE_early(CqlContext context) => + new CqlCode("EVE.early", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("EVE.late")] - public CqlCode EVE_late() => - __EVE_late.Value; - - private CqlCode HS_Value() => - new CqlCode("HS", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode EVE_late(CqlContext context) => + new CqlCode("EVE.late", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("HS")] - public CqlCode HS() => - __HS.Value; - - private CqlCode MORN_Value() => - new CqlCode("MORN", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode HS(CqlContext context) => + new CqlCode("HS", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("MORN")] - public CqlCode MORN() => - __MORN.Value; - - private CqlCode MORN_early_Value() => - new CqlCode("MORN.early", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode MORN(CqlContext context) => + new CqlCode("MORN", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("MORN.early")] - public CqlCode MORN_early() => - __MORN_early.Value; - - private CqlCode MORN_late_Value() => - new CqlCode("MORN.late", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode MORN_early(CqlContext context) => + new CqlCode("MORN.early", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("MORN.late")] - public CqlCode MORN_late() => - __MORN_late.Value; - - private CqlCode NIGHT_Value() => - new CqlCode("NIGHT", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode MORN_late(CqlContext context) => + new CqlCode("MORN.late", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("NIGHT")] - public CqlCode NIGHT() => - __NIGHT.Value; - - private CqlCode NOON_Value() => - new CqlCode("NOON", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode NIGHT(CqlContext context) => + new CqlCode("NIGHT", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("NOON")] - public CqlCode NOON() => - __NOON.Value; - - private CqlCode PC_Value() => - new CqlCode("PC", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode NOON(CqlContext context) => + new CqlCode("NOON", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("PC")] - public CqlCode PC() => - __PC.Value; - - private CqlCode PCD_Value() => - new CqlCode("PCD", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode PC(CqlContext context) => + new CqlCode("PC", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("PCD")] - public CqlCode PCD() => - __PCD.Value; - - private CqlCode PCM_Value() => - new CqlCode("PCM", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode PCD(CqlContext context) => + new CqlCode("PCD", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("PCM")] - public CqlCode PCM() => - __PCM.Value; - - private CqlCode PCV_Value() => - new CqlCode("PCV", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode PCM(CqlContext context) => + new CqlCode("PCM", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("PCV")] - public CqlCode PCV() => - __PCV.Value; - - private CqlCode PHS_Value() => - new CqlCode("PHS", "http://hl7.org/fhir/event-timing", null, null); + public CqlCode PCV(CqlContext context) => + new CqlCode("PCV", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); [CqlDeclaration("PHS")] - public CqlCode PHS() => - __PHS.Value; - - private CqlCode WAKE_Value() => - new CqlCode("WAKE", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); + public CqlCode PHS(CqlContext context) => + new CqlCode("PHS", "http://hl7.org/fhir/event-timing", null, null); [CqlDeclaration("WAKE")] - public CqlCode WAKE() => - __WAKE.Value; + public CqlCode WAKE(CqlContext context) => + new CqlCode("WAKE", "http://terminology.hl7.org/CodeSystem/v3-TimingEvent", null, null); - private CqlCode[] V3TimingEvent_Value() + [CqlDeclaration("V3TimingEvent")] + public CqlCode[] V3TimingEvent(CqlContext context) { var a_ = new CqlCode[] { @@ -299,11 +144,8 @@ private CqlCode[] V3TimingEvent_Value() return a_; } - [CqlDeclaration("V3TimingEvent")] - public CqlCode[] V3TimingEvent() => - __V3TimingEvent.Value; - - private CqlCode[] EventTiming_Value() + [CqlDeclaration("EventTiming")] + public CqlCode[] EventTiming(CqlContext context) { var a_ = new CqlCode[] { @@ -324,22 +166,16 @@ private CqlCode[] EventTiming_Value() return a_; } - [CqlDeclaration("EventTiming")] - public CqlCode[] EventTiming() => - __EventTiming.Value; - - private string ErrorLevel_Value() + [CqlDeclaration("ErrorLevel")] + public string ErrorLevel(CqlContext context) { var a_ = context.ResolveParameter("CumulativeMedicationDurationFHIR4-1.0.000", "ErrorLevel", "Warning"); return (string)a_; } - [CqlDeclaration("ErrorLevel")] - public string ErrorLevel() => - __ErrorLevel.Value; - - private Patient Patient_Value() + [CqlDeclaration("Patient")] + public Patient Patient(CqlContext context) { var a_ = context.Operators.RetrieveByValueSet(null, null); var b_ = context.Operators.SingleOrNull(a_); @@ -347,12 +183,8 @@ private Patient Patient_Value() return b_; } - [CqlDeclaration("Patient")] - public Patient Patient() => - __Patient.Value; - [CqlDeclaration("ToDaily")] - public decimal? ToDaily(int? frequency, CqlQuantity period) + public decimal? ToDaily(CqlContext context, int? frequency, CqlQuantity period) { decimal? a_() { @@ -574,7 +406,7 @@ public Patient Patient() => } else { - var dl_ = this.ErrorLevel(); + var dl_ = this.ErrorLevel(context); var dm_ = context.Operators.Concatenate("Unknown unit ", (period?.unit ?? "")); var dn_ = context.Operators.Message(null, "CMDLogic.ToDaily.UnknownUnit", dl_, dm_); @@ -586,17 +418,17 @@ public Patient Patient() => } [CqlDeclaration("ToDaily")] - public decimal? ToDaily(CqlCode frequency) + public decimal? ToDaily(CqlContext context, CqlCode frequency) { decimal? a_() { - if ((context.Operators.Equal(frequency, this.C()) ?? false)) + if ((context.Operators.Equal(frequency, this.C(context)) ?? false)) { return (decimal?)3.0m; } else { - var b_ = this.ErrorLevel(); + var b_ = this.ErrorLevel(context); var c_ = context.Operators.Concatenate("Unknown frequency code ", (frequency?.code ?? "")); var d_ = context.Operators.Message(null, "CMDLogic.ToDaily.UnknownFrequencyCode", b_, c_); @@ -608,7 +440,7 @@ public Patient Patient() => } [CqlDeclaration("MedicationRequestPeriod")] - public CqlInterval MedicationRequestPeriod(MedicationRequest Request) + public CqlInterval MedicationRequestPeriod(CqlContext context, MedicationRequest Request) { var a_ = new MedicationRequest[] { @@ -618,15 +450,15 @@ CqlInterval b_(MedicationRequest R) { CqlInterval e_() { - if ((context.Operators.Not(context.Operators.Or((bool?)(context.Operators.End(FHIRHelpers_4_0_001.ToInterval(((((context.Operators.SingleOrNull((R?.DosageInstruction as IEnumerable)))?.Timing)?.Repeat)?.Bounds as Period))) is null), context.Operators.Equal(context.Operators.End(FHIRHelpers_4_0_001.ToInterval(((((context.Operators.SingleOrNull((R?.DosageInstruction as IEnumerable)))?.Timing)?.Repeat)?.Bounds as Period))), context.Operators.Maximum()))) ?? false)) + if ((context.Operators.Not(context.Operators.Or((bool?)(context.Operators.End(FHIRHelpers_4_0_001.Instance.ToInterval(context, ((((context.Operators.SingleOrNull((R?.DosageInstruction as IEnumerable)))?.Timing)?.Repeat)?.Bounds as Period))) is null), context.Operators.Equal(context.Operators.End(FHIRHelpers_4_0_001.Instance.ToInterval(context, ((((context.Operators.SingleOrNull((R?.DosageInstruction as IEnumerable)))?.Timing)?.Repeat)?.Bounds as Period))), context.Operators.Maximum()))) ?? false)) { var f_ = context.Operators.SingleOrNull((R?.DosageInstruction as IEnumerable)); - var g_ = FHIRHelpers_4_0_001.ToInterval((f_?.Timing?.Repeat?.Bounds as Period)); + var g_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, (f_?.Timing?.Repeat?.Bounds as Period)); var h_ = context.Operators.Start(g_); - var i_ = FHIRHelpers_4_0_001.ToInterval(R?.DispenseRequest?.ValidityPeriod); + var i_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, R?.DispenseRequest?.ValidityPeriod); var j_ = context.Operators.Start(i_); - var k_ = FHIRHelpers_4_0_001.ToDateTime(R?.AuthoredOnElement); - var m_ = FHIRHelpers_4_0_001.ToInterval((f_?.Timing?.Repeat?.Bounds as Period)); + var k_ = FHIRHelpers_4_0_001.Instance.ToDateTime(context, R?.AuthoredOnElement); + var m_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, (f_?.Timing?.Repeat?.Bounds as Period)); var n_ = context.Operators.End(m_); var o_ = context.Operators.Interval(((h_ ?? j_) ?? k_), n_, true, true); @@ -635,34 +467,34 @@ CqlInterval e_() else { var p_ = context.Operators.SingleOrNull((R?.DosageInstruction as IEnumerable)); - var q_ = FHIRHelpers_4_0_001.ToInterval((p_?.Timing?.Repeat?.Bounds as Period)); + var q_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, (p_?.Timing?.Repeat?.Bounds as Period)); var r_ = context.Operators.Start(q_); - var s_ = FHIRHelpers_4_0_001.ToInterval(R?.DispenseRequest?.ValidityPeriod); + var s_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, R?.DispenseRequest?.ValidityPeriod); var t_ = context.Operators.Start(s_); - var u_ = FHIRHelpers_4_0_001.ToDateTime(R?.AuthoredOnElement); - var w_ = FHIRHelpers_4_0_001.ToInterval((p_?.Timing?.Repeat?.Bounds as Period)); + var u_ = FHIRHelpers_4_0_001.Instance.ToDateTime(context, R?.AuthoredOnElement); + var w_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, (p_?.Timing?.Repeat?.Bounds as Period)); var x_ = context.Operators.Start(w_); var z_ = context.Operators.Start(s_); - var ab_ = FHIRHelpers_4_0_001.ToQuantity(R?.DispenseRequest?.ExpectedSupplyDuration); - var ac_ = FHIRHelpers_4_0_001.ToQuantity(R?.DispenseRequest?.Quantity); + var ab_ = FHIRHelpers_4_0_001.Instance.ToQuantity(context, R?.DispenseRequest?.ExpectedSupplyDuration); + var ac_ = FHIRHelpers_4_0_001.Instance.ToQuantity(context, R?.DispenseRequest?.Quantity); var ae_ = context.Operators.SingleOrNull((p_?.DoseAndRate as IEnumerable)); - var af_ = FHIRHelpers_4_0_001.ToInterval((ae_?.Dose as Range)); + var af_ = FHIRHelpers_4_0_001.Instance.ToInterval(context, (ae_?.Dose as Range)); var ag_ = context.Operators.End(af_); var ai_ = context.Operators.SingleOrNull((p_?.DoseAndRate as IEnumerable)); - var aj_ = FHIRHelpers_4_0_001.ToQuantity((ai_?.Dose as Quantity)); + var aj_ = FHIRHelpers_4_0_001.Instance.ToQuantity(context, (ai_?.Dose as Quantity)); var al_ = context.Operators.Convert(p_?.Timing?.Repeat?.FrequencyMaxElement); var an_ = context.Operators.Convert(p_?.Timing?.Repeat?.FrequencyElement); - var ao_ = FHIRHelpers_4_0_001.ToInteger((al_ ?? an_)); - var aq_ = FHIRHelpers_4_0_001.ToDecimal(p_?.Timing?.Repeat?.PeriodElement); + var ao_ = FHIRHelpers_4_0_001.Instance.ToInteger(context, (al_ ?? an_)); + var aq_ = FHIRHelpers_4_0_001.Instance.ToDecimal(context, p_?.Timing?.Repeat?.PeriodElement); var as_ = context.Operators.Convert(p_?.Timing?.Repeat?.PeriodUnitElement?.Value); - var at_ = this.ToDaily(ao_, new CqlQuantity(aq_, as_)); + var at_ = this.ToDaily(context, ao_, new CqlQuantity(aq_, as_)); var av_ = context.Operators.CountOrNull