Test Cases / NUMER - NUMERPass-TwoEncountersCreatinineDoubled ​ define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text } { codes: [CDCREC 2135-2, Hispanic or Latino], display: "Hispanic or Latino" } define "SDE Payer": [Coverage: type in "Payer"] Payer return { code: Payer.type, period: Payer.period } [{ code: [SOP 211, Medicaid HMO], period: 12/01/2023 12:00:00 AM - null }] define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text } { codes: [CDCREC 1002-5, American Indian or Alaska Native], display: "American Indian or Alaska Native" } define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end CODE: http://hl7.org/fhir/v3/AdministrativeGender F, Female // === TESTING ONLY - DISPLAY ONLY - ends /*--- IPP Criteria ---*/ define "Encounter with Age 18 and Length of Stay 48 Hours or More": ["Encounter": "Encounter Inpatient"] InpatientEncounter where InpatientEncounter.period ends during day of "Measurement Period" and AgeInYearsAt(date from start of InpatientEncounter.period)>= 18 and ( duration in hours of InpatientEncounter.hospitalizationWithObservation() >= 48 ) [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] define "Inpatient Encounter with Creatinine": from "Encounter with Age 18 and Length of Stay 48 Hours or More" Encounter48Hours, ["Observation": "Creatinine Mass Per Volume"] CreatinineTest let HospitalizationPeriod: Encounter48Hours.hospitalizationWithObservation(), CreatinineTestStart: CreatinineTest.effective.earliest() where CreatinineTest.value is not null and CreatinineTestStart during HospitalizationPeriod and CreatinineTestStart during Interval[start of HospitalizationPeriod + 48 hours, end of HospitalizationPeriod] and CreatinineTest.status in { 'final', 'amended', 'corrected'} return Encounter48Hours [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] define "Encounter with Creatinine and without Obstetrical Conditions": "Inpatient Encounter with Creatinine" EncounterWithCreatinine where not exists ( (EncounterWithCreatinine.encounterDiagnosis()) EncounterDiagnosis where EncounterDiagnosis.code in "Obstetrics and VTE Obstetrics" ) [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] define "Initial Population": "Encounter with Creatinine and without Obstetrical Conditions" [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] define "Denominator": "Initial Population" [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] /*--- DENEX Criteria expressions ---*/ define "Encounter with Less Than 2 Creatinine Results within 48 Hours of Arrival": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where ( Count("CreatinineLabTestwithResultwithinFirst48Hours"(QualifyingEncounter)) < 2 ) FALSE ([]) /*--- DISPLAY ONLY - OBSERVATION resources labs during Hospitalization ---*/ /* // DISPLAY ONLY to show lab observation resources in chronologic order, but not needed now define "Serum Creatinine Observations by Time": from // "Encounter with Age 18 and Length of Stay 48 Hours or More" QualifyingEncounter, "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] CreatinineTestByTime where CreatinineTestByTime.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation() and CreatinineTestByTime.value is not null and CreatinineTestByTime.isLaboratory() return CreatinineTestByTime sort by effective */ /* define "DISPLAY ONLY LowestSerumCreatinineIn24Hours function returns": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where "LowestSerumCreatinineIn24Hours"(QualifyingEncounter Encounter) is not null return "LowestSerumCreatinineIn24Hours"(QualifyingEncounter Encounter) define "DISPLAY ONLY EarliestSerumCreatinine function returns": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where "EarliestSerumCreatinine"(QualifyingEncounter Encounter) is not null return "EarliestSerumCreatinine"(QualifyingEncounter Encounter) */ /* define "DISPLAY ONLY SerumCreatinineSequencebyTime function returns": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where exists "SerumCreatinineSequencebyTime"(QualifyingEncounter Encounter) return "SerumCreatinineSequencebyTime"(QualifyingEncounter Encounter) define "DISPLAY ONLY SerumCreatinineSequencebyQuantity function returns": from // "Encounter with Age 18 and Length of Stay 48 Hours or More" QualifyingEncounter, "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] CreatinineTestByTime let CrHospPeriod: QualifyingEncounter.hospitalizationWithObservation(), CrLabId: CreatinineTestByTime.id, CrTime: CreatinineTestByTime.effective.earliest(), // CrTimeIssued: CreatinineTestByTime.issued, CrResult: CreatinineTestByTime.value as Quantity where CrTime during CrHospPeriod return Tuple { AllCr:"SerumCreatinineSequenceByQuantity"(QualifyingEncounter Encounter), LowestCr: "LowestSerumCreatinine"(QualifyingEncounter Encounter), HighestCr: "HighestSerumCreatinine"(QualifyingEncounter Encounter) } */ /*--- DISPLAY ONLY - OBSERVATION resources labs during Hospitalization ---*/ /*--- Capture all specified Creatinine labs during Hospitalization sorted by Time but comment out category/status criteria for now CrLabResult: displays just Lab 'result' which is then followed by subcomponents CrLabResultUnit, CrLabResultValue, CrLabTime, CrLabTimeIssued ---*/ /*-----*/ define "Qualifying Creatinine Lab Result by Time": from "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] CreatinineTestByTime let CrEncId: QualifyingEncounter.id, CrHospPeriod: QualifyingEncounter.hospitalizationWithObservation(), CrLabId: CreatinineTestByTime.id, CrTime: CreatinineTestByTime.effective.earliest(), CrTimeIssued: CreatinineTestByTime.issued, CrResult: CreatinineTestByTime.value as Quantity, CrResultValue: CrResult.value, CrResultUnit: CrResult.unit where CrTime during CrHospPeriod and CreatinineTestByTime.isLaboratory() and CreatinineTestByTime.status in { 'final', 'amended', 'corrected'} and CrResultUnit = 'mg/dL' and CreatinineTestByTime.value is not null and CreatinineTestByTime.value as Quantity > 0 'mg/dL' return Tuple { CrEncInPtId: CrEncId, CrHospitalization: CrHospPeriod, CrLabObsId: CrLabId, // LabCategory: CreatinineTestByQuantity.isLaboratory(), CrLabObsCategory: if CreatinineTestByTime.isLaboratory() then 'laboratory' else CreatinineTestByTime.isLaboratory(), CrLabObsStatus: CreatinineTestByTime.status, CrLabResult: CrResult, CrLabResultUnit: CrResultUnit, CrLabResultValue: CrResultValue, CrLabTime: CrTime, CrLabTimeIssued: CrTimeIssued } sort by CrLabTime [{ CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-01", CrHospitalization: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-15", CrLabObsStatus: "final", CrLabResult: QUANTITY: 0.9 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "0.9", CrLabTime: 10/01/2024 7:00:00 AM, CrLabTimeIssued: 10/01/2024 7:30:00 AM }, { CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-01", CrHospitalization: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-16", CrLabObsStatus: "final", CrLabResult: QUANTITY: 0.9 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "0.9", CrLabTime: 10/01/2024 7:35:00 AM, CrLabTimeIssued: 10/01/2024 8:05:00 AM }, { CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-01", CrHospitalization: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-17", CrLabObsStatus: "final", CrLabResult: QUANTITY: 0.9 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "0.9", CrLabTime: 10/01/2024 8:01:00 AM, CrLabTimeIssued: 10/01/2024 8:31:00 AM }, { CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-01", CrHospitalization: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-18", CrLabObsStatus: "final", CrLabResult: QUANTITY: 1.8 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "1.8", CrLabTime: 10/01/2024 9:01:00 AM, CrLabTimeIssued: 10/01/2024 9:31:00 AM }, { CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-02", CrHospitalization: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-19", CrLabObsStatus: "final", CrLabResult: QUANTITY: 0.91 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "0.91", CrLabTime: 11/01/2024 8:15:00 AM, CrLabTimeIssued: 11/01/2024 8:45:00 AM }, { CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-02", CrHospitalization: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-20", CrLabObsStatus: "final", CrLabResult: QUANTITY: 0.91 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "0.91", CrLabTime: 11/01/2024 10:15:00 AM, CrLabTimeIssued: 11/01/2024 10:45:00 AM }, { CrEncInPtId: "NUMERPass-TwoEncountersCreatinineDoubled-02", CrHospitalization: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM, CrLabObsCategory: "laboratory", CrLabObsId: "NUMERPass-TwoEncountersCreatinineDoubled-21", CrLabObsStatus: "final", CrLabResult: QUANTITY: 1.82 mg/dL, CrLabResultUnit: "mg/dL", CrLabResultValue: "1.82", CrLabTime: 11/03/2024 10:15:00 AM, CrLabTimeIssued: 11/03/2024 10:45:00 AM }] define "Increase of 0.3 or More Using Lowest Creatinine within 24 Hours": from "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] IndexCreatinineLabResult, ["Observation": "Creatinine Mass Per Volume"] SubsequentCreatinineLabResult let IndexCreatinineLabResultTime: IndexCreatinineLabResult.effective.earliest(), SubsequentCreatinineLabResultTime: SubsequentCreatinineLabResult.effective.earliest(), HospitalWithObservationPeriod: QualifyingEncounter.hospitalizationWithObservation() where IndexCreatinineLabResult.status in { 'final', 'amended', 'corrected'} and SubsequentCreatinineLabResult.status in { 'final', 'amended', 'corrected'} and ( ( SubsequentCreatinineLabResult.value as Quantity ) - ( IndexCreatinineLabResult.value as Quantity ) ) > 0.299 'mg/dL' and IndexCreatinineLabResult.value = "LowestSerumCreatinineResult"(QualifyingEncounter) and IndexCreatinineLabResultTime during Interval[SubsequentCreatinineLabResultTime - 48 hours, SubsequentCreatinineLabResultTime] and IndexCreatinineLabResultTime during HospitalWithObservationPeriod and IndexCreatinineLabResultTime during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 24 hours] and SubsequentCreatinineLabResultTime during HospitalWithObservationPeriod and SubsequentCreatinineLabResultTime during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 48 hours] and IndexCreatinineLabResult.id != SubsequentCreatinineLabResult.id return QualifyingEncounter FALSE ([]) // PJM _ singleton to avoid list issue in comparison "EarliestSerumCreatinineResult" define "Increase of 0.3 or More Using First Creatinine within First 48 Hours": from "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] IndexCreatinineLabResult, ["Observation": "Creatinine Mass Per Volume"] SubsequentCreatinineLabResult let IndexCreatinineLabResultTime: IndexCreatinineLabResult.effective.earliest(), SubsequentCreatinineLabResultTime: SubsequentCreatinineLabResult.effective.earliest(), HospitalWithObservationPeriod: QualifyingEncounter.hospitalizationWithObservation() where IndexCreatinineLabResult.status in { 'final', 'amended', 'corrected'} and SubsequentCreatinineLabResult.status in { 'final', 'amended', 'corrected'} and ( ( SubsequentCreatinineLabResult.value as Quantity ) - ( IndexCreatinineLabResult.value as Quantity ) ) > 0.299 'mg/dL' and IndexCreatinineLabResult.value as Quantity = singleton from "EarliestSerumCreatinineResult"(QualifyingEncounter) and IndexCreatinineLabResultTime during Interval[SubsequentCreatinineLabResultTime - 48 hours, SubsequentCreatinineLabResultTime] and IndexCreatinineLabResultTime during HospitalWithObservationPeriod and SubsequentCreatinineLabResultTime during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 48 hours] and SubsequentCreatinineLabResultTime during HospitalWithObservationPeriod and IndexCreatinineLabResultTime during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 48 hours] and SubsequentCreatinineLabResultTime during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 48 hours] and IndexCreatinineLabResult.id != SubsequentCreatinineLabResult.id return QualifyingEncounter FALSE ([]) // PJM following modified to Coalesce to avoid null issue impacting eGFR < 60 /* define "Encounter with 0.3 mg dL or More Increase in Creatinine": if exists "Increase of 0.3 or More Using Lowest Creatinine within 24 Hours" then "Increase of 0.3 or More Using Lowest Creatinine within 24 Hours" else if exists "Increase of 0.3 or More Using First Creatinine within First 48 Hours" then "Increase of 0.3 or More Using First Creatinine within First 48 Hours" else null */ define "Encounter with 0.3 mg dL or More Increase in Creatinine": Coalesce("Increase of 0.3 or More Using Lowest Creatinine within 24 Hours","Increase of 0.3 or More Using First Creatinine within First 48 Hours") FALSE ([]) define "Encounter with High Risk Diagnosis for AKI": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where exists ( (QualifyingEncounter.encounterDiagnosis()) EncounterDiagnosis where ( EncounterDiagnosis.code in "High Risk Diagnosis for AKI" ) ) FALSE ([]) define "Encounter with High Risk Procedures for AKI": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter with ["Procedure": "High Risk Procedures for AKI"] HighRiskProcedures such that HighRiskProcedures.performed.toInterval() starts during QualifyingEncounter.hospitalizationWithObservation() FALSE ([]) define "Encounter with Kidney Dialysis Started 48 Hours or Less After Arrival": from ["Procedure": "Hospital Based Dialysis Services"] Dialysis, "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter let HospitalWithObservationPeriod: QualifyingEncounter.hospitalizationWithObservation() where Dialysis.performed.toInterval() starts during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 48 hours] and Dialysis.performed.toInterval() starts during HospitalWithObservationPeriod return QualifyingEncounter FALSE ([]) /*-----*/ define "Serum Creatinine Normal": if ( Patient.gender = 'female' ) then 1.02 'mg/dL' else if ( Patient.gender = 'male' ) then 1.18 'mg/dL' else null QUANTITY: 1.02 mg/dL /*--- Capture all specified Creatinine labs during Hospitalization sorted by Quantity but comment out category/status criteria for now CrLabResult: displays just Lab 'result' which is then followed by subcomponents CrLabResultUnit, CrLabResultValue, CrLabTime, CrLabTimeIssued ---*/ /*-----*/ // PJM - following definition only used to display pertinent labs sorted by quantity - comment out if not used /* define "DISPLAY ONLY Qualifying Creatinine Lab Result by Quantity": from "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] CreatinineTestByQuantity let CrEncId: QualifyingEncounter.id, CrHospPeriod: QualifyingEncounter.hospitalizationWithObservation(), CrLabId: CreatinineTestByQuantity.id, CrTime: CreatinineTestByQuantity.effective.earliest(), CrTimeIssued: CreatinineTestByQuantity.issued, CrResult: CreatinineTestByQuantity.value as Quantity, CrResultValue: CrResult.value, CrResultUnit: CrResult.unit where CrTime during CrHospPeriod and CreatinineTestByQuantity.isLaboratory() and CreatinineTestByQuantity.status in { 'final', 'amended', 'corrected'} and CrResultUnit = 'mg/dL' and CreatinineTestByQuantity.value is not null and CreatinineTestByQuantity.value as Quantity > 0 'mg/dL' return Tuple { CrEncInPtId: CrEncId, CrHospitalization: CrHospPeriod, CrLabObsId: CrLabId, // LabCategory: CreatinineTestByQuantity.isLaboratory(), CrLabObsCategory: if CreatinineTestByQuantity.isLaboratory() then 'laboratory' else CreatinineTestByQuantity.isLaboratory(), CrLabObsStatus: CreatinineTestByQuantity.status, CrLabResult: CrResult, CrLabResultUnit: CrResultUnit, CrLabResultValue: CrResultValue, CrLabTime: CrTime, CrLabTimeIssued: CrTimeIssued } sort by CrLabResult */ define "Encounter with 1.5 Times Serum Creatinine Increase": from "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter, ["Observation": "Creatinine Mass Per Volume"] HighCreatinineTest, ["Observation": "Creatinine Mass Per Volume"] LowCreatinineTest let LowCreatinineTestTime: LowCreatinineTest.effective.earliest(), HighCreatinineTestTime: HighCreatinineTest.effective.earliest(), HospitalWithObservationPeriod: QualifyingEncounter.hospitalizationWithObservation() where ( HighCreatinineTest.value > "Serum Creatinine Normal" ) and LowCreatinineTest.status in { 'final', 'amended', 'corrected'} and HighCreatinineTest.status in { 'final', 'amended', 'corrected'} and HighCreatinineTest.value = "HighestSerumCreatinineResult"(QualifyingEncounter) and LowCreatinineTest.value = "LowestSerumCreatinineResult"(QualifyingEncounter) and "1.5IncreaseInCreatinine"(QualifyingEncounter)>= LowCreatinineTest.value and LowCreatinineTestTime 7 days or less before HighCreatinineTestTime and LowCreatinineTestTime during HospitalWithObservationPeriod and HighCreatinineTestTime during Interval[start of HospitalWithObservationPeriod + 48 hours, start of HospitalWithObservationPeriod + 30 days] and HighCreatinineTestTime during HospitalWithObservationPeriod return QualifyingEncounter [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] /* return Tuple { HighestCr: HighCreatinineTest.value, LowestCr: LowCreatinineTest.value, RatioCrLabs: HighCreatinineTest.value / LowCreatinineTest.value, ResultEncounter: if HighCreatinineTest.value / LowCreatinineTest.value >= 1.5 'mg/dL' then QualifyingEncounter.id else false } */ define "Encounter with 2 Times Serum Creatinine Increase": from "Encounter with 1.5 Times Serum Creatinine Increase" EncounterWithHighCreatinine, ["Observation": "Creatinine Mass Per Volume"] HighCreatinineTest, ["Observation": "Creatinine Mass Per Volume"] LowCreatinineTest let LowCreatinineTestTime: LowCreatinineTest.effective.earliest(), HighCreatinineTestTime: HighCreatinineTest.effective.earliest(), HospitalWithObservationPeriod: EncounterWithHighCreatinine.hospitalizationWithObservation() where ( HighCreatinineTest.value > "Serum Creatinine Normal" ) and LowCreatinineTest.status in { 'final', 'amended', 'corrected'} and HighCreatinineTest.status in { 'final', 'amended', 'corrected'} and HighCreatinineTest.value = "HighestSerumCreatinineResult"(EncounterWithHighCreatinine) and LowCreatinineTest.value = "LowestSerumCreatinineResult"(EncounterWithHighCreatinine) and ( "2.0IncreaseInCreatinine"(EncounterWithHighCreatinine) as Quantity ) >= ( LowCreatinineTest.value as Quantity ) and LowCreatinineTestTime 7 days or less before HighCreatinineTestTime and LowCreatinineTestTime during HospitalWithObservationPeriod and HighCreatinineTestTime during Interval[start of HospitalWithObservationPeriod + 48 hours, start of HospitalWithObservationPeriod + 30 days] and HighCreatinineTestTime during HospitalWithObservationPeriod return EncounterWithHighCreatinine [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] define "Encounter with Kidney Dialysis Started 48 Hours or Less After Arrival without High Creatinine": "Encounter with Kidney Dialysis Started 48 Hours or Less After Arrival" EncounterWithKidneyDialysis48HoursOrAfter where not ( exists ( "Encounter with 2 Times Serum Creatinine Increase" EncounterWithHighCreatinine where ( EncounterWithHighCreatinine.period includes EncounterWithKidneyDialysis48HoursOrAfter.period ) ) ) FALSE ([]) define "Encounter with Kidney Dialysis Started More Than 48 Hours After Arrival": from ["Procedure": "Hospital Based Dialysis Services"] Dialysis, "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter let HospitalWithObservationPeriod: QualifyingEncounter.hospitalizationWithObservation() where Dialysis.performed.toInterval() starts during Interval[start of HospitalWithObservationPeriod + 48 hours, end of HospitalWithObservationPeriod] and Dialysis.performed.toInterval() starts during HospitalWithObservationPeriod return QualifyingEncounter FALSE ([]) define "Encounter with Kidney Dialysis Started More Than 48 Hours After Arrival without High Creatinine": "Encounter with Kidney Dialysis Started More Than 48 Hours After Arrival" EncounterWithDialysisAfter48Hours where not ( exists ( "Encounter with 2 Times Serum Creatinine Increase" EncounterWithHighCreatinine where ( EncounterWithHighCreatinine.period includes EncounterWithDialysisAfter48Hours.period ) ) ) FALSE ([]) define "Male Encounter with eGFR Less Than 60": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where "MaleeGFR"(QualifyingEncounter) is not null and "MaleeGFR"(QualifyingEncounter) as Decimal < 60 FALSE ([]) define "Female Encounter with eGFR Less Than 60": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter where "FemaleeGFR"(QualifyingEncounter) is not null and "FemaleeGFR"(QualifyingEncounter) as Decimal < 60 FALSE ([]) define "Encounter with Index eGFR Less Than 60 within First 48 Hours": "Male Encounter with eGFR Less Than 60" union "Female Encounter with eGFR Less Than 60" FALSE ([]) define "Denominator Exclusion": "Encounter with Less Than 2 Creatinine Results within 48 Hours of Arrival" union "Encounter with Index eGFR Less Than 60 within First 48 Hours" union "Encounter with 0.3 mg dL or More Increase in Creatinine" union "Encounter with Kidney Dialysis Started 48 Hours or Less After Arrival without High Creatinine" union "Encounter with High Risk Diagnosis for AKI" union "Encounter with High Risk Procedures for AKI" FALSE ([]) /*--- NUMER Criteria ---*/ /*--- modified for DISPLAY ONLY during development impacts MNUMER calc ---*/ define "Numerator": "Encounter with 2 Times Serum Creatinine Increase" union "Encounter with Kidney Dialysis Started More Than 48 Hours After Arrival without High Creatinine" [Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-01 PERIOD: 09/29/2024 8:00:00 AM - 10/03/2024 8:00:00 PM TYPE: [SNOMEDCT 183452005], Encounter ID: NUMERPass-TwoEncountersCreatinineDoubled-02 PERIOD: 11/01/2024 8:00:00 AM - 11/06/2024 8:15:00 PM TYPE: [SNOMEDCT 183452005]] // ===== RISK VARIABLE DEFINITIONS ===== define "Risk Variable Estimated Glomerular Filtration Rate for Females": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter return Tuple { encounterId: QualifyingEncounter.id, eGFR: "FemaleeGFR"(QualifyingEncounter) } [{ eGFR: 82.36717716304419, encounterId: "NUMERPass-TwoEncountersCreatinineDoubled-01" }, { eGFR: 80.77826395836951, encounterId: "NUMERPass-TwoEncountersCreatinineDoubled-02" }] define "Risk Variable Estimated Glomerular Filtration Rate for Males": "Encounter with Creatinine and without Obstetrical Conditions" QualifyingEncounter return Tuple { encounterId: QualifyingEncounter.id, eGFR: "MaleeGFR"(QualifyingEncounter) } [{ eGFR: null, encounterId: "NUMERPass-TwoEncountersCreatinineDoubled-01" }, { eGFR: null, encounterId: "NUMERPass-TwoEncountersCreatinineDoubled-02" }]