Metadata
Title | Hospital Harm - Acute Kidney InjuryFHIR
Version | 1.0.000
Short Name | CMS832FHIR
GUID (Version Independent) | urn:uuid:ceeb6884-0dc4-4f4d-be48-01a6a998b8d2
GUID (Version Specific) | urn:uuid:a163adf2-7e72-4276-857e-4de5115b6bf3
CMS Identifier | 832FHIR
CMS Consensus Based Entity Identifier | 3713e
Effective Period | 2026-01-01 through 2026-12-31
Steward (Publisher) | Centers for Medicare & Medicaid Services (CMS)
Developer | Mathematica
Description | The measure assesses the number of inpatient hospitalizations for patients age 18 and older who have an acute kidney injury (AKI) stage 2 or greater that occurred during the encounter. AKI stage 2 or greater is defined as a substantial increase in serum creatinine value, or by the initiation of kidney dialysis (continuous renal replacement therapy (CRRT), hemodialysis, or peritoneal dialysis).
Copyright | Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. Mathematica disclaims all liability for use or accuracy of any third-party codes contained in the specifications. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024 International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 World Health Organization. All Rights Reserved.
Disclaimer | This performance measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].
Rationale | This measure focuses on stage 2 or greater acute kidney injury as an outcome in the hospital inpatient setting. The incidence of AKI in general hospitalized patients is 10%-20%, and among critically ill patients, the incidence of AKI has been reported as high as 45-50%; in cardiac surgery patients it ranges from 30%-50% (Thongprayoon et al., 2020). Less severe acute kidney injury and acute kidney injury requiring dialysis affect approximately 2,000 to 3,000 and 200 to 300 per million population per year, respectively. Acute kidney injury may result in the need for dialysis, and is associated with an increased risk of mortality (Schwager et al., 2023; Wilson et al., 2013). While not all instances of acute kidney injury are avoidable and may be due to natural progression of underlying illness or a complication of a necessary treatment such as chemotherapy, a proportion of acute kidney injury cases are preventable and treatable. The Kidney Disease: Improving Global Outcomes (KDIGO) guidelines suggest careful management of hemodynamic status, fluids, and vasoactive medications for the prevention of acute kidney injury (KDIGO, 2012). Several studies identified through systematic literature searches developed or evaluated the effectiveness of acute kidney injury electronic alert systems (Schwager et al., 2023; Selby et al., 2012; Ahmed et al., 2015; Porter et al., 2014; Wilson et al., 2014; Kirkendall et al., 2014; Cho et al., 2012). These studies used data elements for defining acute kidney injury that were already present and populated in the electronic health record (EHR). For acute kidney injury diagnosis, all except two were limited to using serum creatinine levels, suggesting that this is the most reliable and consistently available electronic data element for defining acute kidney injury.
Clinical Recommendation Statement | Serum creatinine is an accepted proxy for AKI (Ostermann et al., 2020; KDIGO, 2012). It is cited by many guidelines for defining and monitoring AKI (Lameire et al., 2021; Ostermann et al., 2020; Lopes & Jorge, 2013; KDIGO, 2012). eGFR equations that incorporate creatinine and cystatin C but omit race are more accurate and lead to smaller differences between Black participants and non-Black participants than new equations without race with either creatinine or cystatin C alone (Inker et al., 2021). As a result, a new race-neutral eGFR equation that measures serum creatinine or cystatin C incorporates age, sex, and race to estimate measured GFR has been developed and is recommended by the Task Force from the National Kidney Foundation and American Society of Nephrology (Inker et al., 2021; Diao et al., 2021; Delgado et al., 2021; Delgado et al., 2022). It was recommended by the Task Force to use within the measure a Chronic Kidney Disease Epidemiology Collaboration (CKD-EPI) creatinine equation refit without the race variable. This functionality has been available to all laboratories in the United States (Delgado et al., 2021; Delgado et al., 2022), and has acceptable performance characteristics and potential consequences that do not disproportionately affect any one group of individuals. The KDIGO offers clinical practice guidelines for preventing and managing AKI: FLUIDS 3.1.1: In the absence of hemorrhagic shock, we suggest using isotonic crystalloids rather than colloids (albumin or starches) as initial management for expansion of intravascular volume in patients at risk for acute kidney injury or with acute kidney injury. (Level 2, grade B) VASOPRESSORS 3.1.2: We recommend the use of vasopressors in conjunction with fluids in patients with vasomotor shock with, or at risk for, acute kidney injury. (Level 1, grade C) PROTOCOLIZED HEMODYNAMIC MANAGEMENT 3.1.3: We suggest using protocol-based management of hemodynamic and oxygenation parameters to prevent development or worsening of acute kidney injury in high-risk patients in the perioperative setting (2C) or in patients with septic shock. (Level 2, grade C) KDIGO held a follow-up conference in April of 2019 to review key relevant literature published since the 2012 KDIGO clinical practice recommendations (Ostermann et al., 2020). The effectiveness of the 2012 KDIGO recommendations in preventing AKI was also noted to have been confirmed in small single-center randomized controlled trials (RCTs), such as the Prevention of AKI (PrevAKI) and the Biomarker Guided Intervention for Prevention of AKI (BigpAK) studies (Meersch et al., 2017; Gocze et al., 2018). In addition, results of RCTs have provided new data relevant to several facets of preventing and managing AKI, including early resuscitation, fluid therapy, prevention of contrast-associated AKI, and timing of acute renal replacement therapy (RRT) (Kellum et al., 2016; Nijssen et al., 2017; Self et al., 2018; Zarbock et al, 2016; Gaudry et al., 2016; Barbar et al., 2018).
Citation | Ahmed, A., Vairavan, S., Akhoundi, A., Wilson, G., Chiofolo, C., Chbat, N., & Kashani, K. (2015). Development and validation of electronic surveillance tool for acute kidney injury: A retrospective analysis. Journal of Critical Care, 30(5), 988-993. https://doi.org/10.1016/j.jcrc.2015.05.007
Citation | Barbar, S.D., Clere-Jehl, R., Bourredjem, A., Hernu, R., Montin,i F., Bruyere, R., Lebert, C., Bohe, J., Badie, J., Erald,i J.P., Rigaud, J.P., Levy, B., Siam,i S., Louis, G., Bouadma, L., Constantin, J.M., Mercier, E., Klouche, K., du Cheyron, D., ... Quenot, J.P. (2018). IDEAL-ICU Trial Investigators and the CRICS TRIGGERSEP Network. Timing of renal-replacement therapy in patients with acute kidney injury and sepsis. The New England Journal of Medicine, 379(15), 1431-1442. https://doi.org/10.1056/NEJMoa1803213
Citation | Cho, A., Lee, J.E., Yoon, J.Y., Jang, H.R., Huh, W., Kim, Y.G., & Oh, H.Y. (2012). Effect of an electronic alert on risk of contrast-induced acute kidney injury in hospitalized patients undergoing computed tomography. American Journal of Kidney Diseases, 60(1), 74-81. http://dx.doi.org/10.1053/j.ajkd.2012.02.331
Citation | Delgado, C., Baweja, M., Crews, D.C., Eneanya, N.D., Gadegbeku, C.A., Inker, L.A., Mendu, M L., Miller, W.G., Moxey-Mims, M.M., Roberts, G.V., St Peter, W.L., Warfield, C., & Powe, N.R. (2021). A unifying approach for GFR estimation: Recommendations of the NKF-ASN task force on reassessing the inclusion of race in diagnosing kidney disease. Journal of the American Society of Nephrology, 32(12), 2994-3015. https://doi.org/10.1681/ASN.2021070988
Citation | Delgado, C., Baweja, M., Crews, D.C., Eneanya, N.D., Gadegbeku, C.A., Inker, L.A., Mendu, M.L., Miller, W.G., Moxey-Mims, M.M., Roberts, G.V., St Peter, W.L., Warfield, C., & Powe, N.R. (2022). A unifying approach for GFR estimation: Recommendations of the NKF-ASN task force on reassessing the inclusion of race in diagnosing kidney disease. American Journal of Kidney Diseases, 79(2), 268-288.e1. https://doi.org/10.1053/j.ajkd.2021.08.003
Citation | Diao, J.A., Inker, L.A., Levey, A.S., Tighiouart, H., Powe, N.R., & Manrai, A.K. (2021). In search of a better equation - Performance and equity in estimates of kidney function. The New England Journal of Medicine, 384(5), 396-399. https://doi.org/10.1056/NEJMp2028243
Citation | Gaudry, S., Hajage, D., Schortgen, F., Martin-Lefevre, L., Pons, B., Boulet, E., Boyer, A., Chevrel, G., Lerolle, N., Carpentier, D., de Prost, N., Lautrette, A., Bretagnol, A., Mayaux, J., Nseir, S., Megarbane, B., Thirion, M., Forel, J.M., Maize,l J., ... Dreyfuss, D. (2016). Initiation strategies for renal-replacement therapy in the intensive care unit. New England Journal of Medicine, 375(2), 122-133. https://doi.org/10.1056/NEJMoa1603017
Citation | Gocze, I., Jauch, D., Gotz, M., Kennedy, P., Jung, B., Zeman, F., Gnewuch, C., Graf, B. M., Gnann, W., Banas, B., Bein, T., Schlitt, H. J., & Bergler, T. (2018). Biomarker-guided intervention to prevent acute kidney injury after major surgery: The prospective randomized BigpAK study. Annals of Surgery, 267(6), 1013-1020. https://doi.org/10.1097/SLA.0000000000002485
Citation | Inker, L.A., Eneanya, N.D., Coresh, J., Tighiouart, H., Wang, D., Sang, Y., Crews, D.C., Doria, A., Estrella, M.M., Froissart, M., Grams, M.E., Greene, T., Grubb, A., Gudnason, V., Gutierrez, O.M., Kalil, R., Karger, A.B., Mauer, M., Navis, G., ... Levey, A.S. (2021). New creatinine- and cystatin c-based equations to estimate GFR without race. New England Journal of Medicine, 385(19), 1737-1749. https://doi.org/10.1056/NEJMoa2102953
Citation | Kellum, J.A., Chawla, L.S., Keener, C., Singbartl, K., Palevsky, P.M., Pike, F.L., Yealy, D.M., Huang, D.T., Angus, D.C., & ProCESS and ProGReSS-AKI Investigators. (2016). The effects of alternative resuscitation strategies on acute kidney injury in patients with septic shock. American Journal of Respiratory and Critical Care Medicine, 193(3), 281-287. https://doi.org/10.1164/rccm.201505-0995OC
Citation | Kidney Disease: Improving Global Outcomes (KDIGO) Acute Kidney Injury Work Group. (2012). KDIGO 2012 clinical practice guideline for acute kidney injury. Kidney International, Supplements, 2(1), 1-141. doi:10.1038/kisup.2012.2
Citation | Kirkendall, E.S., Spires, W.L., Mottes, T.A., Schaffzin, J.K., Barclay, C., & Goldstein, S.L. (2014). Development and performance of electronic acute kidney injury triggers to identify pediatric patients at risk for nephrotoxic medication-associated harm. Applied Clinical Informatics, 5(2), 313-333. https://doi.org/10.4338/ACI-2013-12-RA-0102
Citation | Lameire, N.H., Levin, A., Kellum, J.A., Cheung, M., Jadoul, M., Winkelmayer, W.C., Stevens, P.E., & Conference Participants. (2021). Harmonizing acute and chronic kidney disease definition and classification: report of a Kidney Disease: Improving Global Outcomes (KDIGO) Consensus Conference. Kidney International, 100(3), 516-526. https://doi.org/10.1016/j.kint.2021.06.028
Citation | Lopes, J.A., & Jorge, S. (2013). The RIFLE and AKIN classifications for acute kidney injury: A critical and comprehensive review. Clinical Kidney Journal, 6(1), 8-14. https://doi.org/10.1093/ckj/sfs160
Citation | Meersch, M., Schmidt, C., Hoffmeier, A., Van Aken, H., Wempe, C., Gerss, J., & Zarbock, A. (2017). Prevention of cardiac surgery-associated AKI by implementing the KDIGO guidelines in high risk patients identified by biomarkers: the PrevAKI randomized controlled trial. Intensive Care Medicine, 43(11), 1551-1561. https://doi.org/10.1007/s00134-016-4670-3
Citation | Nijssen, E.C., Rennenberg, R.J., Nelemans, P.J., Essers, B.A., Janssen, M.M., Vermeeren, M.A., Ommen, V.V., & Wildberger, J.E. (2017). Prophylactic hydration to protect renal function from intravascular iodinated contrast material in patients at high risk of contrast-induced nephropathy (AMACING): a prospective, randomised, phase 3, controlled, open-label, non-inferiority trial. Lancet, 389(10076), 1312-1322. https://doi.org/10.1016/S0140-6736(17)30057-0
Citation | Ostermann, M., Bellomo, R., Burdmann, E.A., Doi, K., Endre, Z.H., Goldstein, S.L., Kane-Gill, S.L., Liu, K.D., Prowle, J.R., Shaw, A.D., Srisawat, N., Cheung, M., Jadoul, M., Winkelmayer, W.C., Kellum, J.A., & Conference Participants. (2020). Controversies in acute kidney injury: conclusions from a Kidney Disease: Improving Global Outcomes (KDIGO) Conference. Kidney international, 98(2), 294-309. https://doi.org/10.1016/j.kint.2020.04.020
Citation | Porter, C.J., Juurlink, I., Bisset, L.H., Bavakunji, R., Mehta, R.L., & Devonald, M.A. (2014). A real-time electronic alert to improve detection of acute kidney injury in a large teaching hospital. Nephrology Dialysis Transplantation, 29(10), 1888-1893. https://doi.org/10.1093/ndt/gfu082
Citation | Schwager, E., Ghosh, E., Eshelman, L., Pasupathy, K.S., Barreto, E.F., & Kashani, K. (2023). Accurate and interpretable prediction of ICU-acquired AKI. Journal of Critical Care, 75, 154278. https://doi.org/10.1016/j.jcrc.2023.154278
Citation | Selby, N.M., Crowley, L., Fluck, R.J., McIntyre, C.W., Monaghan, J., Lawson, N., & Kolhe, N.V. (2012). Use of electronic results reporting to diagnose and monitor AKI in hospitalized patients. Clinical Journal of The American Society of Nephrology, 7(4), 533-540. https://doi.org/10.2215/cjn.08970911
Citation | Self, W.H., Semler, M.W., Wanderer, J.P., Wang, L., Byrne, D.W., Collins, S.P., Slovis, C.M., Lindsell, C.J., Ehrenfeld, J.M., Siew, E.D., Shaw, A.D., Bernard, G.R., Rice, T.W., & SALT-ED Investigators. (2018). Balanced crystalloids versus saline in noncritically ill adults. The New England Journal of Medicine, 378(9), 819-828. https://doi.org/10.1056/NEJMoa1711586
Citation | Thongprayoon, C., Hansrivijit, P., Kovvuru, K., Kanduri, S.R., Torres-Ortiz, A., Acharya, P., Gonzalez-Suarez, M.L., Kaewput, W., Bathini, T., & Cheungpasitporn, W. (2020). Diagnostics, risk factors, treatment and outcomes of acute kidney injury in a new paradigm. Journal of Clinical Medicine. 9(4), 1104. https://doi.org/10.3390/jcm9041104
Citation | Wilson, F. P., Yang, W., & Feldman, H.I. (2013). Predictors of death and dialysis in severe AKI: The UPHS-AKI cohort. Clinical Journal of the American Society of Nephrology, 8(4), 527-537. https://doi.org/10.2215/cjn.06450612
Citation | Wilson, F.P., Reese, P.P., Shashaty, M.G., Ellenberg, S.S., Gitelman, Y., Bansal, A.D., & Fuchs, B. (2014). A trial of in-hospital, electronic alerts for acute kidney injury: Design and rationale. Clinical Trials, 11(5), 521-529. https://doi.org/10.1177/1740774514542619
Citation | Zarbock, A., Kellum, J.A., Schmidt, C., Van Aken, H., Wempe, C., Pavenstadt, H., Boanta, A., Ger, J., & Meersch, M. (2016). Effect of early vs delayed initiation of renal replacement therapy on mortality in critically ill patients with acute kidney injury: The ELAIN Randomized Clinical Trial. Journal of the American Medical Association, 315(20), 2190-2199. https://doi.org/10.1001/jama.2016.5828
Guidance (Usage) | A patient characteristic of male or female sex is required as part of the initial population criteria, as sex is crucial to this measure. For example: The eGFR estimating equation that is used to identify AKI is sex-specific; and The reference ranges for the serum creatinine value are sex-specific, which matters because the serum creatinine must rise to a sex-specific abnormal value to be flagged as AKI. Exclude encounters that do not have at least two serum creatine values within 48 hours of arrival. Two values are needed within this timeframe to determine if the patient has AKI or moderate-to-severe renal dysfunction on arrival. For encounters for patients without harm, as identified by 2 times increase in serum creatinine, query for initiation of renal dialysis during hospitalization, defined by the start of dialysis occurring during the encounter. If dialysis starts more than 48 hours after the start of the encounter, this meets numerator criteria. If dialysis starts 48 hours or less after the start of the encounter, this meets denominator exclusion criteria. Encounters for patients with an increase in serum creatinine value of at least 0.3 between the index serum creatinine and any subsequent serum creatinine taken within 48 hours of the encounter start are excluded. Due to the variability of decimal precision within programming languages and calculation tools, the value of >=0.3 is expressed in the logic as >0.299. Note the measure is currently confined to using mg/dL as the unit of measurement for creatinine and mL/min as the unit of measurement for eGFR results. When reporting the first body temperature for risk adjustment, values from either Celsius or Fahrenheit readings are acceptable to report but Celsius readings are preferred. This dQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure: CMS832v3. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU6/) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html).
Measure Group (Rate) (ID: Group_1)
Basis | Encounter
Scoring | [http://terminology.hl7.org/CodeSystem/measure-scoring#proportion: 'Proportion']
Type | [http://terminology.hl7.org/CodeSystem/measure-type#outcome: 'Outcome']
Rate Aggregation | None
Improvement Notation | [http://terminology.hl7.org/CodeSystem/measure-improvement-notation#decrease: 'Decreased score indicates improvement']
Initial Population | ID: InitialPopulation_1 Description: Inpatient hospitalizations that end during the measurement period for patients 18 years of age or older without an obstetrical or pregnancy related condition, with a length of stay of 48 hours or longer, and who had at least one serum creatinine value after 48 hours from the start of the hospitalization Logic Definition: Initial Population
Denominator | ID: Denominator_1 Description: Equals Initial Population Logic Definition: Denominator
Denominator Exclusion | ID: DenominatorExclusion_1 Description: Inpatient hospitalizations for patients with an increase in serum creatinine value of at least 0.3 mg/dL between the index serum creatinine and a subsequent serum creatinine taken within 48 hours of the encounter start. Inpatient hospitalizations for patients with the index eGFR value of <60 mL/min within 48 hours of the encounter start. Inpatient hospitalizations for patients who have less than two serum creatinine results within the first 48 hours of the encounter start. Inpatient hospitalizations for patients who have kidney dialysis (CRRT, hemodialysis or peritoneal dialysis) initiated 48 hours or less after the encounter start, and who do not have evidence of a 2 times increase in serum creatinine. Inpatient hospitalizations for patients with at least one specified diagnosis present on admission during the encounter that puts them at extremely high risk for AKI: Hemolytic Uremic Syndrome (HUS) Large Body Surface Area (BSA) Burns Traumatic Avulsion of Kidney Rapidly Progressive Nephritic Syndrome Thrombotic Thrombocytopenic Purpura Out of Hospital Cardiac Arrest (OHCA) Inpatient hospitalizations for patients who have at least one specified procedure that starts during the encounter that puts them at extremely high risk for AKI: Extracorporeal membrane oxygenation (ECMO) Intra-Aortic Balloon Pump Resuscitative Endovascular Balloon Occlusion of the Aorta (REBOA) Nephrectomy Logic Definition: Denominator Exclusion
Numerator | ID: Numerator_1 Description: Inpatient hospitalizations for patients who develop AKI stage 2 or greater during the encounter, as evidenced by: A subsequent increase in serum creatinine value at least 2 times higher than the lowest serum creatinine value, and the increased value is greater than the highest sex-specific normal value for serum creatinine. Or: Kidney dialysis (CRRT, hemodialysis, or peritoneal dialysis) initiated more than 48 hours after the start of the encounter. Evidence of a 2 times increase in serum creatinine is not required. Only one harm is counted per encounter. Logic Definition: Numerator
Supplemental Data Guidance | For every patient evaluated by this measure also identify payer, race, ethnicity and sex
Supplemental Data Guidance | Sex and Age First vital signs since the encounter start: Heart Rate: {Beats}/min Respiratory Rate: {Breaths}/min Systolic Blood Pressure: mm[Hg] Temperature: Cel [degF] The estimated glomerular filtration rate (eGFR) is calculated using the index serum creatinine, patient sex, and age-based formula. Patient sex collected for risk adjustment and to calculate the eGFR is determined by the "Federal Administrative Sex" value set, which is also used to derive the supplemental data element of patient sex for the measure. All encounter diagnoses along with their present on admission (POA) indicators are being collected for the development of baseline risk adjustment model with initial focus on any encounter diagnoses captured for: Cancer (leukemia, lymphoma, or metastatic cancer) Diabetes Heart failure Hypertension Obesity Encounter length of stay (days) Please see the included Hospital Harm - Acute Kidney Injury Risk Adjustment Methodology Report.
Supplemental Data Elements
Supplemental Data Element | ID: sde-ethnicity Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Ethnicity Logic Definition: SDE Ethnicity
Supplemental Data Element | ID: sde-payer Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Payer Logic Definition: SDE Payer
Supplemental Data Element | ID: sde-race Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Race Logic Definition: SDE Race
Supplemental Data Element | ID: sde-sex Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Sex Logic Definition: SDE Sex
Supplemental Data Element | ID: risk-variable-estimated-glomerular-filtration-rate-for-females Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Estimated Glomerular Filtration Rate For Females Logic Definition: Risk Variable Estimated Glomerular Filtration Rate For Females
Supplemental Data Element | ID: risk-variable-estimated-glomerular-filtration-rate-for-males Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Estimated Glomerular Filtration Rate For Males Logic Definition: Risk Variable Estimated Glomerular Filtration Rate For Males
Supplemental Data Element | ID: risk-variable-all-encounter-diagnoses-with-poa-indication Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable All Encounter Diagnoses With POA Indication Logic Definition: Risk Variable All Encounter Diagnoses With POA Indication
Supplemental Data Element | ID: risk-variable-first-heart-rate-in-encounter Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable First Heart Rate In Encounter Logic Definition: Risk Variable First Heart Rate In Encounter
Supplemental Data Element | ID: risk-variable-first-respiratory-rate-in-encounter Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable First Respiratory Rate In Encounter Logic Definition: Risk Variable First Respiratory Rate In Encounter
Supplemental Data Element | ID: risk-variable-first-systolic-blood-pressure-in-encounter Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable First Systolic Blood Pressure In Encounter Logic Definition: Risk Variable First Systolic Blood Pressure In Encounter
Supplemental Data Element | ID: risk-variable-first-temperature-in-encounter Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable First Temperature In Encounter Logic Definition: Risk Variable First Temperature In Encounter
Measure Logic
Primary Library | https://madie.cms.gov/Library/CMS832FHIRHHAKI
Contents | Population Criteria Logic Definitions Terminology Dependencies Data Requirements
Population Criteria
Measure Group (Rate) (ID: Group_1)
Initial Population
    define "Initial Population":
      "Encounter With Creatinine And Without Obstetrical Conditions"
Denominator
    define "Denominator":
      "Initial Population"
Denominator Exclusion
    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"
Numerator
    define "Numerator":
      "Encounter With 2 Times Serum Creatinine Increase"
        union "Encounter With Kidney Dialysis Started More Than 48 Hours After Arrival Without High Creatinine"
Logic Definitions
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Race":
      Patient.race R
        return Tuple {
          codes: R.ombCategory union R.detailed,
          display: R.text
        }
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Sex":
      case
        when Patient.sex = '248153007' then "Male (finding)"
        when Patient.sex = '248152002' then "Female (finding)"
        else null
      end
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Payer":
      [Coverage: type in "Payer Type"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Ethnicity":
      Patient.ethnicity E
        return Tuple {
          codes: { E.ombCategory } union E.detailed,
          display: E.text
        }
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value uri): value.value
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
    value to a CQL DateTime Interval
    @comment: If the start value of the given period is unspecified, the starting
    boundary of the resulting interval will be open (meaning the start of the interval
    is unknown, as opposed to interpreted as the beginning of time).
    */
    define function ToInterval(period FHIR.Period):
        if period is null then
            null
        else
            if period."start" is null then
                Interval(period."start".value, period."end".value]
            else
                Interval[period."start".value, period."end".value]
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
    */
    define function ToConcept(concept FHIR.CodeableConcept):
        if concept is null then
            null
        else
            System.Concept {
                codes: concept.coding C return ToCode(C),
                display: concept.text.value
            }
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
    */
    define function ToCode(coding FHIR.Coding):
        if coding is null then
            null
        else
            System.Code {
              code: coding.code.value,
              system: coding.system.value,
              version: coding.version.value,
              display: coding.display.value
            }
Logic Definition | Library Name: CQMCommon
    /*
    @description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter
    */
    define fluent function hospitalizationWithObservation(TheEncounter Encounter ):
      TheEncounter Visit
      		let ObsVisit: Last([Encounter: "Observation Services"] LastObs
      				where LastObs.status = 'finished'
                and LastObs.period ends 1 hour or less on or before start of Visit.period
      				sort by end of period
      			),
      			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
      			EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
      				where LastED.status = 'finished'
                and LastED.period ends 1 hour or less on or before VisitStart
      				sort by end of period
      			)
      		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Condition resources referenced by the diagnosis element of the Encounter
    */
    define fluent function encounterDiagnosis(Encounter Encounter ):
      Encounter.reasonReference D
        return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.references(C.id))
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Given an interval, return the starting point if the interval has a starting boundary specified,
    otherwise, return the ending point
    */
    define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):
      (choice.toInterval()) period
        return
          if (period."hasStart"()) then start of period
          else end of period
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Given an interval, return true if the interval has a starting boundary specified
    (i.e. the start of the interval is not null and not the minimum DateTime value)
    */
    define fluent function hasStart(period Interval<DateTime> ):
      not ( start of period is null
          or start of period = minimum DateTime
      )
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns true if the given reference is to the given resourceId
    @comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(reference Reference, resourceId String):
      resourceId = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns true if the given observation is a laboratory observation
    */
    define fluent function isLaboratory(observation Choice<"SimpleObservation",
    "ObservationCancelled",
    "NonPatientObservation",
    "LaboratoryResultObservation",
    "ObservationClinicalResult",
    "ObservationScreeningAssessment">):
      exists (observation.category C
        where C ~ "laboratory"
      )
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
    @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types
    to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
    representations for timing-valued elements in QICore, allowing this function to be used across any resource.
    The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.
    The intent of this function is to provide a clear and concise mechanism to treat single
    elements that have multiple possible representations as intervals so that logic doesn't have to account
    for the variability. More complex calculations (such as medication request period or dispense period
    calculation) need specific guidance and consideration. That guidance may make use of this function, but
    the focus of this function is on single element calculations where the semantics are unambiguous.
    If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.
    If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
    and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
    If the input is a DateTime Interval, the result is the input.
    If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
    is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
    immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
    If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
    */
    define fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>, Timing>):
      case
    	  when choice is DateTime then
        	Interval[choice as DateTime, choice as DateTime]
    		when choice is Interval<DateTime> then
      		choice as Interval<DateTime>
    		when choice is Quantity then
    		  Interval[Patient.birthDate + (choice as Quantity),
    			  Patient.birthDate + (choice as Quantity) + 1 year)
    		when choice is Interval<Quantity> then
    		  Interval[Patient.birthDate + (choice.low as Quantity),
    			  Patient.birthDate + (choice.high as Quantity) + 1 year)
    		when choice is Timing then
          Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval<DateTime>
    		else
    			null as Interval<DateTime>
    	end
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns true if any of the given references are to the given resource
    @comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(references List<Reference>, resource Resource):
      exists (references R where R.references(resource))
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns true if the given reference is to the given resource
    @comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(reference Reference, resource Resource):
      resource.id = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With Age 18 And Length Of Stay 48 Hours Or More":
      ["Encounter": "Encounter Inpatient"] InpatientEncounter
        where Patient.sex in { "Male (finding)".code, "Female (finding)".code }
          and InpatientEncounter.period ends during day of "Measurement Period"
          and InpatientEncounter.status = 'finished'
          and AgeInYearsAt(date from start of InpatientEncounter.period) >= 18
          and ( duration in hours of InpatientEncounter.hospitalizationWithObservation ( ) >= 48 )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Inpatient Encounter With Creatinine":
      from
        "Encounter With Age 18 And Length Of Stay 48 Hours Or More" Encounter48Hours,
        ["LaboratoryResultObservation": "Creatinine Mass Per Volume"] CreatinineTest
        let HospitalizationPeriod: Encounter48Hours.hospitalizationWithObservation ( ),
        CreatinineTestStart: CreatinineTest.effective.earliest ( )
        where CreatinineTest.value as Quantity is not null
          and CreatinineTestStart during Interval[start of HospitalizationPeriod + 48 hours, end of HospitalizationPeriod]
          and CreatinineTest.status in { 'final', 'amended', 'corrected' }
        return Encounter48Hours
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With Creatinine And Without Obstetrical Conditions":
      "Inpatient Encounter With Creatinine" EncounterWithCreatinine
        where not ( EncounterWithCreatinine.reasonCode in "Obstetrics and VTE Obstetrics"
            or EncounterWithCreatinine.encounterDiagnosis ( ).code in "Obstetrics and VTE Obstetrics"
        )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable First Respiratory Rate In Encounter":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        return Tuple {
          encounterId: QualifyingEncounter.id,
          firstRespiratoryRate: "QualifyingEncounter".firstRespiratoryRate ( )
        }
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Qualifying Creatinine Lab Result By Time":
      from
        "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter,
        ["LaboratoryResultObservation": "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,
          CrLabObsCategory: if CreatinineTestByTime.isLaboratory ( ) then 'laboratory'
            else CreatinineTestByTime.isLaboratory ( ),
          CrLabObsCategory: CreatinineTestByTime.category,
          CrLabObsStatus: CreatinineTestByTime.status,
          CrLabResult: CrResult,
          CrLabResultUnit: CrResultUnit,
          CrLabResultValue: CrResultValue,
          CrLabTime: CrTime,
          CrLabTimeIssued: CrTimeIssued
        }
        sort by CrLabTime
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable Estimated Glomerular Filtration Rate For Males":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        return Tuple {
          encounterId: QualifyingEncounter.id,
          eGFR: "QualifyingEncounter".maleeGFR ( )
        }
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Qualifying Blood Pressure Reading":
      ["USCoreBloodPressureProfile"] BloodPressure
        where BloodPressure.effective.earliest ( ) during day of "Measurement Period"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable First Systolic Blood Pressure In Encounter":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        return Tuple {
          encounterId: QualifyingEncounter.id,
          firstSystolicBP: "QualifyingEncounter".firstSystolicBloodPressure ( )
        }
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "SDE Race":
      SDE."SDE Race"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "SDE Sex":
      SDE."SDE Sex"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable Estimated Glomerular Filtration Rate For Females":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        return Tuple {
          encounterId: QualifyingEncounter.id,
          eGFR: "QualifyingEncounter".femaleeGFR ( )
        }
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable First Heart Rate In Encounter":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        return Tuple {
          encounterId: QualifyingEncounter.id,
          firstHeartRate: "QualifyingEncounter".firstHeartRate ( )
        }
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Serum Creatinine Normal":
      if ( Patient.sex = "Female (finding)".code ) then 1.02 'mg/dL'
        else 1.18 'mg/dL'
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With 1.5 Times Serum Creatinine Increase":
      from
        "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter,
        ["LaboratoryResultObservation": "Creatinine Mass Per Volume"] HighCreatinineTest,
        ["LaboratoryResultObservation": "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 = "QualifyingEncounter".highestSerumCreatinineResult ( )
          and LowCreatinineTest.value = "QualifyingEncounter".lowestSerumCreatinineResult ( )
          and "QualifyingEncounter".oneAndAHalfIncreaseInCreatinine ( ) >= 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
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With 2 Times Serum Creatinine Increase":
      from
        "Encounter With 1.5 Times Serum Creatinine Increase" EncounterWithHighCreatinine,
        ["LaboratoryResultObservation": "Creatinine Mass Per Volume"] HighCreatinineTest,
        ["LaboratoryResultObservation": "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 = "EncounterWithHighCreatinine".highestSerumCreatinineResult ( )
          and LowCreatinineTest.value = "EncounterWithHighCreatinine".lowestSerumCreatinineResult ( )
          and ( HighCreatinineTest.value 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
Logic Definition | Library Name: CMS832FHIRHHAKI
    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
          and Dialysis.status = 'completed'
        return QualifyingEncounter
Logic Definition | Library Name: CMS832FHIRHHAKI
    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 )
          )
        )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Numerator":
      "Encounter With 2 Times Serum Creatinine Increase"
        union "Encounter With Kidney Dialysis Started More Than 48 Hours After Arrival Without High Creatinine"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable All Encounter Diagnoses With POA Indication":
      from
        "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter,
        [Claim] clm
        where clm.status = 'active'
          and clm.use = 'claim'
          and exists ( clm.item ClaimItem
              where ClaimItem.encounter.references ( QualifyingEncounter )
                and exists ( clm.diagnosis Dx
                    where Dx.sequence in clm.item.diagnosisSequence
                      and Dx.onAdmission in "Present on Admission or Clinically Undetermined"
                )
          )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Initial Population":
      "Encounter With Creatinine And Without Obstetrical Conditions"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Denominator":
      "Initial Population"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "SDE Payer":
      SDE."SDE Payer"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Risk Variable First Temperature In Encounter":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        return Tuple {
          encounterId: QualifyingEncounter.id,
          firstTemperature: "QualifyingEncounter".firstBodyTemperature ( )
        }
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With Less Than 2 Creatinine Results Within 48 Hours Of Arrival":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        where ( Count("QualifyingEncounter".creatinineLabTestwithResultwithinFirst48Hours()) < 2 )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Male Encounter With eGFR Less Than 60":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        where "QualifyingEncounter".maleeGFR ( ) is not null
          and "QualifyingEncounter".maleeGFR ( ) as Decimal < 60
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Female Encounter With eGFR Less Than 60":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        where "QualifyingEncounter".femaleeGFR ( ) is not null
          and "QualifyingEncounter".femaleeGFR ( ) as Decimal < 60
Logic Definition | Library Name: CMS832FHIRHHAKI
    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"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Increase Of 0.3 Or More Using Lowest Creatinine Within 24 Hours":
      from
        "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter,
        ["LaboratoryResultObservation": "Creatinine Mass Per Volume"] IndexCreatinineLabResult,
        ["LaboratoryResultObservation": "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 = "QualifyingEncounter".lowestSerumCreatinineResult ( )
          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
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Increase Of 0.3 Or More Using First Creatinine Within First 48 Hours":
      from
        "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter,
        ["LaboratoryResultObservation": "Creatinine Mass Per Volume"] IndexCreatinineLabResult,
        ["LaboratoryResultObservation": "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 "QualifyingEncounter".earliestSerumCreatinineResult ( )
          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 IndexCreatinineLabResult.id != SubsequentCreatinineLabResult.id
        return QualifyingEncounter
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With 0.3 mg dL Or More Increase In Creatinine":
      "Increase Of 0.3 Or More Using Lowest Creatinine Within 24 Hours"
        union "Increase Of 0.3 Or More Using First Creatinine Within First 48 Hours"
Logic Definition | Library Name: CMS832FHIRHHAKI
    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.status = 'completed'
          and Dialysis.performed.toInterval ( ) starts during Interval[start of HospitalWithObservationPeriod, start of HospitalWithObservationPeriod + 48 hours]
          and Dialysis.performed.toInterval ( ) starts during HospitalWithObservationPeriod
        return QualifyingEncounter
Logic Definition | Library Name: CMS832FHIRHHAKI
    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 )
          )
        )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define "Encounter With High Risk Diagnosis For AKI":
      "Encounter With Creatinine And Without Obstetrical Conditions" QualifyingEncounter
        where ( QualifyingEncounter.reasonCode in "High Risk Diagnosis for AKI"
            or QualifyingEncounter.encounterDiagnosis ( ).code in "High Risk Diagnosis for AKI"
        )
Logic Definition | Library Name: CMS832FHIRHHAKI
    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.status = 'completed'
            and HighRiskProcedures.performed.toInterval ( ) starts during QualifyingEncounter.hospitalizationWithObservation ( )
Logic Definition | Library Name: CMS832FHIRHHAKI
    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"
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "firstRespiratoryRate"(QualifyingEncounter Encounter):
      First(["USCoreRespiratoryRateProfile"] FirstRespiration
          where FirstRespiration.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
            and FirstRespiration.value is not null
          sort by effective.earliest()
      ).value as Quantity
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "maleeGFR"(QualifyingEncounter Encounter):
      if Patient.sex = "Male (finding)".code then ( 142 * Min({("QualifyingEncounter".indexCreatinine().value / 0.9), 1 }) ^ ( - 0.302 ) * Max({("QualifyingEncounter".indexCreatinine().value / 0.9), 1 }) ^ ( - 1.200 ) * 0.9938 ^ ( AgeInYearsAt(start of QualifyingEncounter.hospitalizationWithObservation()) ) )
        else null
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "indexCreatinine"(QualifyingEncounter Encounter):
      Coalesce("QualifyingEncounter".lowestSerumCreatinineIn24Hours(), singleton from "QualifyingEncounter".firstSerumCreatinineIn48Hours())
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "lowestSerumCreatinineIn24Hours"(QualifyingEncounter Encounter):
      Min((from
            "Qualifying Creatinine Lab Result By Time" LabTestsLow
            let LabResult: LabTestsLow.CrLabResult
            where LabTestsLow.CrEncInPtId = QualifyingEncounter.id
              and LabTestsLow.CrLabTime during Interval[start of QualifyingEncounter.hospitalizationWithObservation(), start of QualifyingEncounter.hospitalizationWithObservation() + 24 hours]
        ).CrLabResult
      )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "firstSerumCreatinineIn48Hours"(QualifyingEncounter Encounter):
      from
        "Qualifying Creatinine Lab Result By Time" LabTests
        let LabResult: LabTests.CrLabResult
        where ( "QualifyingEncounter".earliestSerumCreatinineTimeIn48Hours ( ) = LabTests.CrLabTime )
        return LabResult as Quantity
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "earliestSerumCreatinineTimeIn48Hours"(QualifyingEncounter Encounter):
      ( Min((from
              "Qualifying Creatinine Lab Result By Time" LabTests48
              let LabResult48: LabTests48.CrLabResult
              where LabTests48.CrEncInPtId = QualifyingEncounter.id
                and LabTests48.CrLabTime during Interval[start of QualifyingEncounter.hospitalizationWithObservation(), start of QualifyingEncounter.hospitalizationWithObservation() + 48 hours]
          ).CrLabTime
        )
      )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "firstSystolicBloodPressure"(QualifyingEncounter Encounter):
      First("Qualifying Blood Pressure Reading" SBPReading
          where SBPReading.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
          return singleton from(SBPReading.component SBPComponent
              where SBPComponent.code ~ "Systolic blood pressure"
              return SBPComponent.value as Quantity
          )
      )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "femaleeGFR"(QualifyingEncounter Encounter):
      if Patient.sex = "Female (finding)".code then ( 142 * Min({("QualifyingEncounter".indexCreatinine().value / 0.7), 1 }) ^ ( - 0.241 ) * Max({("QualifyingEncounter".indexCreatinine().value / 0.7), 1 }) ^ ( - 1.200 ) * 0.9938 ^ ( AgeInYearsAt(start of QualifyingEncounter.hospitalizationWithObservation()) ) * 1.012 )
        else null
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "firstHeartRate"(QualifyingEncounter Encounter):
      First(["USCoreHeartRateProfile"] FirstHeartBeats
          where FirstHeartBeats.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
            and FirstHeartBeats.value is not null
          sort by effective.earliest()
      ).value as Quantity
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "highestSerumCreatinineResult"(QualifyingEncounter Encounter):
      ( Max((from
              "Qualifying Creatinine Lab Result By Time" LabTests
              let LabResult: LabTests.CrLabResult
              where LabTests.CrEncInPtId = QualifyingEncounter.id
          ).CrLabResult
        )
      )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "lowestSerumCreatinineResult"(QualifyingEncounter Encounter):
      ( Min((from
              "Qualifying Creatinine Lab Result By Time" LabTests
              let LabResult: LabTests.CrLabResult
              where LabTests.CrEncInPtId = QualifyingEncounter.id
          ).CrLabResult
        )
      )
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "oneAndAHalfIncreaseInCreatinine"(QualifyingEncounter Encounter):
      "QualifyingEncounter".highestSerumCreatinineResult ( ) / 1.5
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "firstBodyTemperature"(QualifyingEncounter Encounter):
      First(["USCoreBodyTemperatureProfile"] FirstTemperature
          where FirstTemperature.effective.earliest() during QualifyingEncounter.hospitalizationWithObservation()
            and FirstTemperature.value is not null
          sort by effective.earliest()
      ).value as Quantity
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "creatinineLabTestwithResultwithinFirst48Hours"(QualifyingEncounter Encounter):
      from
        ["LaboratoryResultObservation": "Creatinine Mass Per Volume"] CreatinineTest
        where CreatinineTest.value as Quantity is not null
          and CreatinineTest.effective.earliest ( ) during Interval[start of QualifyingEncounter.hospitalizationWithObservation ( ), start of QualifyingEncounter.hospitalizationWithObservation ( ) + 48 hours]
          and CreatinineTest.effective.earliest ( ) during QualifyingEncounter.hospitalizationWithObservation ( )
          and CreatinineTest.status in { 'final', 'amended', 'corrected' }
        return CreatinineTest
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "earliestSerumCreatinineResult"(QualifyingEncounter Encounter):
      from
        "Qualifying Creatinine Lab Result By Time" LabTests
        let LabResult: LabTests.CrLabResult
        where ( "QualifyingEncounter".earliestSerumCreatinineTime ( ) = LabTests.CrLabTime )
        return LabResult as Quantity
Logic Definition | Library Name: CMS832FHIRHHAKI
    define fluent function "earliestSerumCreatinineTime"(QualifyingEncounter Encounter):
      ( Min((from
              "Qualifying Creatinine Lab Result By Time" LabTestsEarly
              let LabResultEarly: LabTestsEarly.CrLabResult
              where LabTestsEarly.CrEncInPtId = QualifyingEncounter.id
          ).CrLabTime
        )
      )
Terminology
Code System | Description: Code system SNOMEDCT Resource: http://snomed.info/sct Canonical URL: `http://snomed.info/sct`
Code System | Description: Code system ObservationCategoryCodes Resource: http://terminology.hl7.org/CodeSystem/observation-category Canonical URL: `http://terminology.hl7.org/CodeSystem/observation-category`
Code System | Description: Code system LOINC Resource: http://loinc.org Canonical URL: `http://loinc.org`
Value Set | Description: Value set Encounter Inpatient Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307`
Value Set | Description: Value set Observation Services Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143`
Value Set | Description: Value set Emergency Department Visit Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292`
Value Set | Description: Value set Creatinine Mass Per Volume Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.21 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.21`
Value Set | Description: Value set Obstetrics and VTE Obstetrics Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.33 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.33`
Value Set | Description: Value set Hospital Based Dialysis Services Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.199 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.199`
Value Set | Description: Value set Present on Admission or Clinically Undetermined Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197`
Value Set | Description: Value set Payer Type Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591`
Value Set | Description: Value set High Risk Diagnosis for AKI Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.12 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.12`
Value Set | Description: Value set High Risk Procedures for AKI Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.19 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.19`
Direct Reference Code | Display: Male Code: 248153007 System: `http://snomed.info/sct`
Direct Reference Code | Display: Female Code: 248152002 System: `http://snomed.info/sct`
Direct Reference Code | Display: Laboratory Code: laboratory System: `http://terminology.hl7.org/CodeSystem/observation-category`
Direct Reference Code | Display: Systolic blood pressure Code: 8480-6 System: `http://loinc.org`
Dependencies
Dependency | Description: QICore model information Resource: http://hl7.org/fhir/Library/QICore-ModelInfo Canonical URL: `http://hl7.org/fhir/Library/QICore-ModelInfo`
Dependency | Description: Library FHIRHelpers Resource: https://madie.cms.gov/Library/FHIRHelpers|4.4.000 Canonical URL: `https://madie.cms.gov/Library/FHIRHelpers|4.4.000`
Dependency | Description: Library CQMCommon Resource: https://madie.cms.gov/Library/CQMCommon|4.1.000 Canonical URL: `https://madie.cms.gov/Library/CQMCommon|4.1.000`
Dependency | Description: Library QICoreCommon Resource: https://madie.cms.gov/Library/QICoreCommon|4.0.000 Canonical URL: `https://madie.cms.gov/Library/QICoreCommon|4.0.000`
Dependency | Description: Library SDE Resource: https://madie.cms.gov/Library/SupplementalDataElements|5.1.000 Canonical URL: `https://madie.cms.gov/Library/SupplementalDataElements|5.1.000`
Data Requirements
Data Requirement | Type: Patient Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Must Support Elements: extension, url, birthDate, birthDate.value
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, status, status.value, period, reasonCode, id, id.value Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, status, status.value, period, reasonCode, id, id.value Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, period, status, status.value, reasonCode, id, id.value Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: id, period, reasonCode, id.value
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, value, status, status.value, id, id.value, issued, issued.value, category Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.21
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate Must Support Elements: effective, value
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/core/StructureDefinition/us-core-blood-pressure Must Support Elements: effective, component
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate Must Support Elements: effective, value
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, performed, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.199
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.19
Data Requirement | Type: Resource Profile(s): http://hl7.org/fhir/StructureDefinition/Resource Must Support Elements: id, id.value
Data Requirement | Type: Claim Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim Must Support Elements: status, status.value, use, use.value, item, diagnosis
Data Requirement | Type: Coverage Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage Must Support Elements: type, period Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature Must Support Elements: effective, value
Generated using version 0.4.8 of the sample-content-ig Liquid templates