{
    "_id" : "64232951f9a010eeafc2a053",
    "title" : "Hospital Harm - Severe Hyperglycemia",
    "description" : "This measure assesses the number of inpatient hospital days for patients age 18 and older with a hyperglycemic event (harm) per the total qualifying inpatient hospital days for that encounter",
    "component_hqmf_set_ids" : [

    ],
    "measure_scoring" : "RATIO",
    "calculation_method" : "EPISODE_OF_CARE",
    "hqmf_id" : "2C928082-7FAC-C041-0180-1F512619243F",
    "hqmf_set_id" : "EF95493C-3F65-4440-9CCB-EAF1B9ED1210",
    "main_cql_library" : "HospitalHarmHyperglycemiainHospitalizedPatients",
    "hqmf_version_number" : "2.0.027",
    "cms_id" : "CMS871v2",
    "composite" : false,
    "component" : false,
    "calculate_sdes" : null,
    "value_set_ids" : [
        "64232951f9a010eeafc2a046",
        "64232951f9a010eeafc2a047",
        "64232951f9a010eeafc2a048",
        "64232951f9a010eeafc2a049",
        "64232951f9a010eeafc2a04a",
        "64232951f9a010eeafc2a04b",
        "64232951f9a010eeafc2a04c",
        "64232951f9a010eeafc2a04d",
        "64232951f9a010eeafc2a04e",
        "64232951f9a010eeafc2a04f",
        "64232951f9a010eeafc2a050",
        "64232951f9a010eeafc2a051"
    ],
    "measure_attributes" : [
        {
            "code" : "OTH",
            "value" : "871",
            "name" : "eCQM Identifier (Measure Authoring Tool)",
            "code_obj" : {
                "type" : "CD",
                "null_flavor" : "OTH",
                "original_text" : "eCQM Identifier (Measure Authoring Tool)"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "871",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "OTH",
            "value" : "3533e",
            "name" : "NQF Number",
            "code_obj" : {
                "type" : "CD",
                "null_flavor" : "OTH",
                "original_text" : "NQF Number"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "3533e",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "COPY",
            "value" : "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. American Institutes for Research(R), formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications.\n\nLOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved.",
            "name" : "Copyright",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "COPY",
                "title" : "Copyright"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "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. American Institutes for Research(R), formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications.\n\nLOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved.",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "DISC",
            "value" : "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.\n\nTHE MEASURES AND SPECIFICATIONS ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND.\n\nDue to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].",
            "name" : "Disclaimer",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "DISC",
                "title" : "Disclaimer"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "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.\n\nTHE MEASURES AND SPECIFICATIONS ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND.\n\nDue to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "MSRSCORE",
            "name" : "Measure Scoring",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "MSRSCORE",
                "title" : "Measure Scoring"
            },
            "value_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.1063",
                "code" : "RATIO",
                "title" : "Ratio"
            }
        },
        {
            "code" : "MSRTYPE",
            "name" : "Measure Type",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "MSRTYPE",
                "title" : "Measure Type"
            },
            "value_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.1063",
                "code" : "OUTCOME",
                "title" : "OUTCOME"
            }
        },
        {
            "code" : "MSRADJ",
            "value" : "None",
            "name" : "Risk Adjustment",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "MSRADJ",
                "title" : "Risk Adjustment"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "None",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "MSRAGG",
            "value" : "None",
            "name" : "Rate Aggregation",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "MSRAGG",
                "title" : "Rate Aggregation"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "None",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "RAT",
            "value" : "Hyperglycemia, i.e., elevated glucose level, is common among hospitalized patients, especially those with preexisting diabetes (Umpierrez et al., 2012) and account for over 30% of noncritically ill hospitalized patients (Korytkowski, 2022). Hyperglycemia can also affect individuals with no prior history of diabetes and may be induced by medications such as steroids, or parenteral (intravenous) or enteral (tube) feeding.\n\nSevere hyperglycemia, i.e., extremely elevated glucose level, is significantly associated with a range of harms, including increased in-hospital mortality, infection rates, and hospital length of stay (Pasquel, et al., 2021; Umpierrez et al., 2012, 2015). Lower rates of inpatient severe hyperglycemia may not only improve care for patients, but also reduce costs for healthcare payers (Krinsley et al., 2016). The rate of hyperglycemia varies across hospitals, suggesting opportunities for improvement in inpatient glycemic management (Bersoux et al., 2013). The rate of inpatient hyperglycemia can be considered a marker for quality of hospital care, since inpatient hyperglycemia is largely avoidable with proper glycemic management. The use of evidence-based standardized protocols and insulin management protocols have been shown to improve glycemic control and safety (Leroy et al., 2020; Maynard et al., 2015).\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting, 2022:\nRecommendation 1.1\nIn adults with insulin-treated diabetes hospitalized for noncritical illness who are at high risk of hypoglycemia, we suggest the use of real-time continuous glucose monitoring (CGM) with confirmatory bedside point-of-care blood glucose (POC-BG) monitoring for adjustments in insulin dosing rather than point-of-care blood glucose (POC-BG) testing alone in hospital settings where resources and training are available.",
            "name" : "Rationale",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "RAT",
                "title" : "Rationale"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Hyperglycemia, i.e., elevated glucose level, is common among hospitalized patients, especially those with preexisting diabetes (Umpierrez et al., 2012) and account for over 30% of noncritically ill hospitalized patients (Korytkowski, 2022). Hyperglycemia can also affect individuals with no prior history of diabetes and may be induced by medications such as steroids, or parenteral (intravenous) or enteral (tube) feeding.\n\nSevere hyperglycemia, i.e., extremely elevated glucose level, is significantly associated with a range of harms, including increased in-hospital mortality, infection rates, and hospital length of stay (Pasquel, et al., 2021; Umpierrez et al., 2012, 2015). Lower rates of inpatient severe hyperglycemia may not only improve care for patients, but also reduce costs for healthcare payers (Krinsley et al., 2016). The rate of hyperglycemia varies across hospitals, suggesting opportunities for improvement in inpatient glycemic management (Bersoux et al., 2013). The rate of inpatient hyperglycemia can be considered a marker for quality of hospital care, since inpatient hyperglycemia is largely avoidable with proper glycemic management. The use of evidence-based standardized protocols and insulin management protocols have been shown to improve glycemic control and safety (Leroy et al., 2020; Maynard et al., 2015).\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting, 2022:\nRecommendation 1.1\nIn adults with insulin-treated diabetes hospitalized for noncritical illness who are at high risk of hypoglycemia, we suggest the use of real-time continuous glucose monitoring (CGM) with confirmatory bedside point-of-care blood glucose (POC-BG) monitoring for adjustments in insulin dosing rather than point-of-care blood glucose (POC-BG) testing alone in hospital settings where resources and training are available.",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "CRS",
            "value" : "It should be noted that this measure does not aim to measure overall glucose control in hospitalized patients; rather, our goal is to assess the occurrence and extent of severe hyperglycemia. This measure is also intended to be used in combination with its companion measure of hypoglycemia (Hospital Harm – Hypoglycemia) to reduce unintended consequences of measurement. \n\nMultiple guidelines address recommended levels of glycemic control, though these do not define severe hyperglycemia: \n\nFrom Section 16, Diabetes Care in the Hospital, in the Standards of Medical Care in Diabetes by the American Diabetes Association, (American Diabetes Association, 2022): \n\n16.4 Insulin therapy should be initiated for treatment of persistent hyperglycemia starting at a threshold ≥180 mg/dL (10.0 mmol/L) (checked on two occasions). Once insulin therapy is started, a target glucose range of 140–180 mg/dL (7.8–10.0 mmol/L) is recommended for the majority of critically ill and noncritically ill patients. A\n\n16.5 More stringent goals, such as 110–140 mg/dL (6.1–7.8 mmol/L), may be appropriate for selected patients if they can be achieved without significant hypoglycemia.\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting (2022): \n\nRecommendation 10.1\nIn adults with no prior history of diabetes hospitalized for noncritical illness with hyperglycemia [defined as blood glucose (BG) > 140 mg/dL (7.8 mmol/L)] during hospitalization, we suggest initial therapy with correctional insulin over scheduled insulin therapy (defined as basal or basal/bolus insulin) to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For patients with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL (≥10.0 mmol/L) in a 24-hour period on correctional insulin alone], we suggest the addition of scheduled insulin therapy. \n\nRecommendation 10.2\nIn adults with diabetes treated with diet or noninsulin diabetes medications prior to admission, we suggest initial therapy with correctional insulin or scheduled insulin therapy to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For hospitalized adults started on correctional insulin alone and with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL in a 24-hour period (≥10.0 mmol/L)], we suggest addition of scheduled insulin therapy. We suggest initiation of scheduled insulin therapy for patients with confirmed admission blood glucose (BG) ≥ 180 mg/dL (≥10.0 mmol/L). \n\nRecommendation 10.3\nIn adults with insulin-treated diabetes prior to admission who are hospitalized for noncritical illness, we recommend continuation of the scheduled insulin regimen modified for nutritional status and severity of illness to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L).\n\nRemarks\nReductions in the dose of basal insulin (by 10% to 20%) at time of hospitalization may be required for patients on basal heavy insulin regimens (defined as doses of basal insulin ≥ 0.6 to 1.0 units/kg/day), in which basal insulin is being used inappropriately to cover meal-related excursions in BG.\n\n\nThere is no clinically accepted cutoff for severe hyperglycemia. Studies have used thresholds of >140, >180 , >300, and >350 mg/dL, among other values (American Diabetes Association, 2020; Umpierrez et al, 2012, 2015); Jamesen et al., 2015; Donihi et al., 2011; Mendez et al, 2015). BGL <180 mg/dL is associated with lower rates of mortality and stroke compared with a target glucose <200 mg/dL (Sathya, et al., 2013). Glycemic goals may also differ among hospitalized patients. For example, in an older patient with a prior history of severe hypoglycemia, some degree of hyperglycemia may be tolerated to maximize safety. Intensive insulin therapy to target glucose of 100 and 140mg/dLin the ICU didn’t significantly reduce perioperative complications compared with target glucose of 141and180mg/dLafter coronary artery bypass surgery (Umpierrez, 2015).\n\nFor patients who present with hyperglycemic crises, neurologic status must be monitored closely, with frequent re-examination. Care should be taken to prevent over-correction of hyperglycemia and hyperosmolarity following initial ﬂuid resuscitation of these patients to prevent cerebral edema, which carries a high mortality rate. (Gosmanov et al., 2021).",
            "name" : "Clinical Recommendation Statement",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "CRS",
                "title" : "Clinical Recommendation Statement"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "It should be noted that this measure does not aim to measure overall glucose control in hospitalized patients; rather, our goal is to assess the occurrence and extent of severe hyperglycemia. This measure is also intended to be used in combination with its companion measure of hypoglycemia (Hospital Harm – Hypoglycemia) to reduce unintended consequences of measurement. \n\nMultiple guidelines address recommended levels of glycemic control, though these do not define severe hyperglycemia: \n\nFrom Section 16, Diabetes Care in the Hospital, in the Standards of Medical Care in Diabetes by the American Diabetes Association, (American Diabetes Association, 2022): \n\n16.4 Insulin therapy should be initiated for treatment of persistent hyperglycemia starting at a threshold ≥180 mg/dL (10.0 mmol/L) (checked on two occasions). Once insulin therapy is started, a target glucose range of 140–180 mg/dL (7.8–10.0 mmol/L) is recommended for the majority of critically ill and noncritically ill patients. A\n\n16.5 More stringent goals, such as 110–140 mg/dL (6.1–7.8 mmol/L), may be appropriate for selected patients if they can be achieved without significant hypoglycemia.\n\nFrom the Endocrine Society clinical practice guideline on the Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting (2022): \n\nRecommendation 10.1\nIn adults with no prior history of diabetes hospitalized for noncritical illness with hyperglycemia [defined as blood glucose (BG) > 140 mg/dL (7.8 mmol/L)] during hospitalization, we suggest initial therapy with correctional insulin over scheduled insulin therapy (defined as basal or basal/bolus insulin) to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For patients with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL (≥10.0 mmol/L) in a 24-hour period on correctional insulin alone], we suggest the addition of scheduled insulin therapy. \n\nRecommendation 10.2\nIn adults with diabetes treated with diet or noninsulin diabetes medications prior to admission, we suggest initial therapy with correctional insulin or scheduled insulin therapy to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L). For hospitalized adults started on correctional insulin alone and with persistent hyperglycemia [≥2 point-of-care blood glucose (POC-BG) measurements ≥ 180 mg/dL in a 24-hour period (≥10.0 mmol/L)], we suggest addition of scheduled insulin therapy. We suggest initiation of scheduled insulin therapy for patients with confirmed admission blood glucose (BG) ≥ 180 mg/dL (≥10.0 mmol/L). \n\nRecommendation 10.3\nIn adults with insulin-treated diabetes prior to admission who are hospitalized for noncritical illness, we recommend continuation of the scheduled insulin regimen modified for nutritional status and severity of illness to maintain glucose targets in the range of 100 to 180 mg/dL (5.6 to 10.0 mmol/L).\n\nRemarks\nReductions in the dose of basal insulin (by 10% to 20%) at time of hospitalization may be required for patients on basal heavy insulin regimens (defined as doses of basal insulin ≥ 0.6 to 1.0 units/kg/day), in which basal insulin is being used inappropriately to cover meal-related excursions in BG.\n\n\nThere is no clinically accepted cutoff for severe hyperglycemia. Studies have used thresholds of >140, >180 , >300, and >350 mg/dL, among other values (American Diabetes Association, 2020; Umpierrez et al, 2012, 2015); Jamesen et al., 2015; Donihi et al., 2011; Mendez et al, 2015). BGL <180 mg/dL is associated with lower rates of mortality and stroke compared with a target glucose <200 mg/dL (Sathya, et al., 2013). Glycemic goals may also differ among hospitalized patients. For example, in an older patient with a prior history of severe hypoglycemia, some degree of hyperglycemia may be tolerated to maximize safety. Intensive insulin therapy to target glucose of 100 and 140mg/dLin the ICU didn’t significantly reduce perioperative complications compared with target glucose of 141and180mg/dLafter coronary artery bypass surgery (Umpierrez, 2015).\n\nFor patients who present with hyperglycemic crises, neurologic status must be monitored closely, with frequent re-examination. Care should be taken to prevent over-correction of hyperglycemia and hyperosmolarity following initial ﬂuid resuscitation of these patients to prevent cerebral edema, which carries a high mortality rate. (Gosmanov et al., 2021).",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "IDUR",
            "value" : "A lower measure score indicates higher quality",
            "name" : "Improvement Notation",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "IDUR",
                "title" : "Improvement Notation"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "A lower measure score indicates higher quality",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONAmerican Diabetes Association Professional Practice Committee; 16. (2022). Diabetes Care in the Hospital: Standards of Medical Care in Diabetes—2022. Diabetes Care 1 January 2022; 45 (Supplement_1): S244–S253.  https://doi.org/10.2337/dc22-S016",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONAmerican Diabetes Association Professional Practice Committee; 16. (2022). Diabetes Care in the Hospital: Standards of Medical Care in Diabetes—2022. Diabetes Care 1 January 2022; 45 (Supplement_1): S244–S253.  https://doi.org/10.2337/dc22-S016",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONBersoux, S., Cook, C.B., Kongable, G.L., Shu, J. (2013). Trends in glycemic control over a 2-year period in 126 US hospitals. J Hosp Med. 2013;8(3):121-125. doi:10.1002/jhm.1997",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONBersoux, S., Cook, C.B., Kongable, G.L., Shu, J. (2013). Trends in glycemic control over a 2-year period in 126 US hospitals. J Hosp Med. 2013;8(3):121-125. doi:10.1002/jhm.1997",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONDonihi, A.C., Gibson, J.M., Noschese, M.L., et al. (2011). Effect of targeted glycemic management program on provider response to inpatient hyperglycemia. Endocr Pract. 2011; (4)552-557",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONDonihi, A.C., Gibson, J.M., Noschese, M.L., et al. (2011). Effect of targeted glycemic management program on provider response to inpatient hyperglycemia. Endocr Pract. 2011; (4)552-557",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONGosmanov, A.R., Gosmanova, E.O., Kitabchi, A.E. (2021). Hyperglycemic Crises: Diabetic Ketoacidosis and Hyperglycemic Hyperosmolar State. [Updated 2021 May 9]. In: Feingold KR, Anawalt B, Boyce A, et al., editors. Endotext [Internet]. South Dartmouth (MA): MDText.com, Inc.; 2000-. Retrieved from: https://www.ncbi.nlm.nih.gov/books/NBK279052/",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONGosmanov, A.R., Gosmanova, E.O., Kitabchi, A.E. (2021). Hyperglycemic Crises: Diabetic Ketoacidosis and Hyperglycemic Hyperosmolar State. [Updated 2021 May 9]. In: Feingold KR, Anawalt B, Boyce A, et al., editors. Endotext [Internet]. South Dartmouth (MA): MDText.com, Inc.; 2000-. Retrieved from: https://www.ncbi.nlm.nih.gov/books/NBK279052/",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONJamesen, E., Nevalainen, P.L., Eskelinen, A., et al. (2015). Risk factors for perioperative hyperglycemia in primary hip and knee replacements. Acta Orthop. 2015; 86(2):175-182",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONJamesen, E., Nevalainen, P.L., Eskelinen, A., et al. (2015). Risk factors for perioperative hyperglycemia in primary hip and knee replacements. Acta Orthop. 2015; 86(2):175-182",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONKorytkowski, M.T., Muniyappa, R., Antinori-Lent, K., Donihi, A.C., Drincic, A.T, Hirsch, I.B., Luger, A., McDonnell, M.E., Murad, M.H., Nielsen, C., Pegg, C., Rushakoff, R.J., Santesso, N., Umpierrez, G.E. (2022). Management of Hyperglycemia in Hospitalized Adult Patients in Non-Critical Care Settings: An Endocrine Society Clinical Practice Guideline, The Journal of Clinical Endocrinology & Metabolism, Volume 107, Issue 8, August 2022, Pages 2101–2128,  https://doi.org/10.1210/clinem/dgac278",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONKorytkowski, M.T., Muniyappa, R., Antinori-Lent, K., Donihi, A.C., Drincic, A.T, Hirsch, I.B., Luger, A., McDonnell, M.E., Murad, M.H., Nielsen, C., Pegg, C., Rushakoff, R.J., Santesso, N., Umpierrez, G.E. (2022). Management of Hyperglycemia in Hospitalized Adult Patients in Non-Critical Care Settings: An Endocrine Society Clinical Practice Guideline, The Journal of Clinical Endocrinology & Metabolism, Volume 107, Issue 8, August 2022, Pages 2101–2128,  https://doi.org/10.1210/clinem/dgac278",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONKrinsley, J.S., Jones, R.L. (2016). Cost analysis of intensive glycemic control in critically ill adult patients. Chest. 2016;129(3)644-650",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONKrinsley, J.S., Jones, R.L. (2016). Cost analysis of intensive glycemic control in critically ill adult patients. Chest. 2016;129(3)644-650",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONLeRoy, L.,  Richard, S. (2020). Harms Due to Diabetic Agents (Chapter 8), Making Healthcare Safer III: A Critical Analysis of Existing and Emerging Patient Safety Practices. Retrieved from: https://www.ahrq.gov/sites/default/files/wysiwyg/research/findings/making-healthcare-safer/mhs3/diabetes-1.pdf",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONLeRoy, L.,  Richard, S. (2020). Harms Due to Diabetic Agents (Chapter 8), Making Healthcare Safer III: A Critical Analysis of Existing and Emerging Patient Safety Practices. Retrieved from: https://www.ahrq.gov/sites/default/files/wysiwyg/research/findings/making-healthcare-safer/mhs3/diabetes-1.pdf",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONMaynard, G., Kulasa, K., Ramos, P., et al. (2015). Impact of a hypoglycemic reduction bundle and a systems approach to inpatient glycemic management. Endocr Pract. 2015;21(4):355-367",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONMaynard, G., Kulasa, K., Ramos, P., et al. (2015). Impact of a hypoglycemic reduction bundle and a systems approach to inpatient glycemic management. Endocr Pract. 2015;21(4):355-367",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONMendez, C.E., Ata, A., Rourke, J.M., et al. (2015). Daily inpatient glycemic survey (DINGS): A process to remotely identify and assist in the management of hospitalized patients with diabetes and hyperglycemia. Endocr Pract. 2015;21(8):927-935",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONMendez, C.E., Ata, A., Rourke, J.M., et al. (2015). Daily inpatient glycemic survey (DINGS): A process to remotely identify and assist in the management of hospitalized patients with diabetes and hyperglycemia. Endocr Pract. 2015;21(8):927-935",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONPasquel, F.J., Lansang, M.C., Dhatariya, K., Umpierrez, G.E. (2021). Management of diabetes and hyperglycaemia in the hospital. The Lancet Diabetes & Endocrinology. 2021; 9: 174–88",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONPasquel, F.J., Lansang, M.C., Dhatariya, K., Umpierrez, G.E. (2021). Management of diabetes and hyperglycaemia in the hospital. The Lancet Diabetes & Endocrinology. 2021; 9: 174–88",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONSathya, B., Davis, R., Taveira, T., et al. (2013). Intensity of peri-operative glycemic control and postoperative outcomes in patients with diabetes: a meta-analysis. Diabetes Res Clin Pract. 2013;102(1):815.10.1016/j.diabres.2013.05.003",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONSathya, B., Davis, R., Taveira, T., et al. (2013). Intensity of peri-operative glycemic control and postoperative outcomes in patients with diabetes: a meta-analysis. Diabetes Res Clin Pract. 2013;102(1):815.10.1016/j.diabres.2013.05.003",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONUmpierrez, G., Cardona, S., Pasquel, F., et al. (2015). Randomized controlled trial of intensive versus conservative glucose control in patients undergoing coronary artery bypass graft surgery: gluco-CABG trial. Diabetes Care. 2015;38(9):1665-1672",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONUmpierrez, G., Cardona, S., Pasquel, F., et al. (2015). Randomized controlled trial of intensive versus conservative glucose control in patients undergoing coronary artery bypass graft surgery: gluco-CABG trial. Diabetes Care. 2015;38(9):1665-1672",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "REF",
            "value" : "CITATIONUmpierrez, G.E., Hellman, R., Korytkowski, M.T., et al. (2012). Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2012;97, 16-38",
            "name" : "Reference",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "REF",
                "title" : "Reference"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "CITATIONUmpierrez, G.E., Hellman, R., Korytkowski, M.T., et al. (2012). Management of Hyperglycemia in Hospitalized Patients in Non-critical Care Setting: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2012;97, 16-38",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "DEF",
            "value" : "Inpatient hospitalizations: Includes time in the emergency department and observation when the transition between these encounters (if they exist) and the inpatient encounter are within an hour or less of each other. \n\nThis measure defines a severe hyperglycemic day (harm) as either (1) a day with a test (lab or point-of-care (POC)) for glucose with a result of >300 mg/dL, or (2) a day in which a glucose test with a result was not found and it was preceded by two consecutive days where at least one lab or point-of-care (POC) test during each of the two days for glucose had a result >=200 mg/dL. \n\nHospital days are not defined as midnight-to-midnight but are full 24-hour periods that start at the time of admission to the hospital (including emergency department and observation), excluding the last period before discharge from hospital inpatient if it is less than 24 hours.",
            "name" : "Definition",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "DEF",
                "title" : "Definition"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Inpatient hospitalizations: Includes time in the emergency department and observation when the transition between these encounters (if they exist) and the inpatient encounter are within an hour or less of each other. \n\nThis measure defines a severe hyperglycemic day (harm) as either (1) a day with a test (lab or point-of-care (POC)) for glucose with a result of >300 mg/dL, or (2) a day in which a glucose test with a result was not found and it was preceded by two consecutive days where at least one lab or point-of-care (POC) test during each of the two days for glucose had a result >=200 mg/dL. \n\nHospital days are not defined as midnight-to-midnight but are full 24-hour periods that start at the time of admission to the hospital (including emergency department and observation), excluding the last period before discharge from hospital inpatient if it is less than 24 hours.",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "GUIDE",
            "value" : "The measure is using mg/dL as the unit of measurement for glucose results.\n\nTo determine the measure outcome, the total number of hyperglycemic days during the inpatient hospitalization is divided by the total number of eligible hospital days of the inpatient hospitalization.\n\nWhen evaluating for days with a glucose level >300 mg/dL, the first 24-hour period after admission to the hospital (including the emergency department or observation) is not evaluated to account for potentially poor glucose control outside of the hospital setting or that preceded the start of hospital care.\n\nThis measure evaluates the first 10 days of an eligible inpatient hospitalization in determining eligible days for the denominator and numerator (i.e., the length of stay is truncated to <=10 days when the length exceeds 10 days). Patients admitted for longer length of stays are more likely to have more complex medical conditions.  \n\nThe “Days in Hospitalization” logic within Measure Observation 1 (associated with the denominator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hospital days (e.g., from day 2 to day 10). \n\nThe “Days in Hospitalization” logic within Measure Observation 2 (associated with the numerator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hyperglycemic event days (e.g., from day 2 to day 10).\n\nSince the measure does not count any hyperglycemic events that occur in the first 24 hours, day 1 is not considered an eligible hospital day for the Measure Observations. Eligible days range from day 2 up to day 10.\n\nAlthough the measure does not count any hyperglycemic events that occur in the first 24 hours as a hyperglycemic event day in Measure Observation 2, the first 24 hours of the encounter is considered day 1. This is because if there was a day during the encounter where a glucose result is not found, the measure evaluates the two days preceding to see if each had a glucose value >=200 mg/dL. The measure allows the first 24 hours of the encounter, i.e., day 1, to be one of the preceding days.\n\nMultiple hyperglycemic events can occur during a ‘day’, but this is still considered one hyperglycemic event day.\n\nThe numerator returns the first eligible encounter that meets the qualifying criteria: an inpatient hospitalization with a hyperglycemic event. Only one numerator is counted per encounter. Note that the Numerator returns the encounters, not days, that meet the criteria.\n\nThe specimen source for the glucose test is blood, serum, plasma, or interstitial fluid, and can be obtained by a laboratory test, a Point of Care (POC) test, or a continuous glucose monitor (CGM). Glucose test results from urine specimens are not considered.\n\nThis eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.\n\nThis version of the eCQM uses QDM version 5.6. Please refer to the eCQI resource center (https://ecqi.healthit.gov/qdm) for more information on the QDM.",
            "name" : "Guidance",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "GUIDE",
                "title" : "Guidance"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "The measure is using mg/dL as the unit of measurement for glucose results.\n\nTo determine the measure outcome, the total number of hyperglycemic days during the inpatient hospitalization is divided by the total number of eligible hospital days of the inpatient hospitalization.\n\nWhen evaluating for days with a glucose level >300 mg/dL, the first 24-hour period after admission to the hospital (including the emergency department or observation) is not evaluated to account for potentially poor glucose control outside of the hospital setting or that preceded the start of hospital care.\n\nThis measure evaluates the first 10 days of an eligible inpatient hospitalization in determining eligible days for the denominator and numerator (i.e., the length of stay is truncated to <=10 days when the length exceeds 10 days). Patients admitted for longer length of stays are more likely to have more complex medical conditions.  \n\nThe “Days in Hospitalization” logic within Measure Observation 1 (associated with the denominator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hospital days (e.g., from day 2 to day 10). \n\nThe “Days in Hospitalization” logic within Measure Observation 2 (associated with the numerator), in conjunction with other logic, returns the day number (e.g., day 1 to day 10) for each day within the hospitalization period to determine the eligible hyperglycemic event days (e.g., from day 2 to day 10).\n\nSince the measure does not count any hyperglycemic events that occur in the first 24 hours, day 1 is not considered an eligible hospital day for the Measure Observations. Eligible days range from day 2 up to day 10.\n\nAlthough the measure does not count any hyperglycemic events that occur in the first 24 hours as a hyperglycemic event day in Measure Observation 2, the first 24 hours of the encounter is considered day 1. This is because if there was a day during the encounter where a glucose result is not found, the measure evaluates the two days preceding to see if each had a glucose value >=200 mg/dL. The measure allows the first 24 hours of the encounter, i.e., day 1, to be one of the preceding days.\n\nMultiple hyperglycemic events can occur during a ‘day’, but this is still considered one hyperglycemic event day.\n\nThe numerator returns the first eligible encounter that meets the qualifying criteria: an inpatient hospitalization with a hyperglycemic event. Only one numerator is counted per encounter. Note that the Numerator returns the encounters, not days, that meet the criteria.\n\nThe specimen source for the glucose test is blood, serum, plasma, or interstitial fluid, and can be obtained by a laboratory test, a Point of Care (POC) test, or a continuous glucose monitor (CGM). Glucose test results from urine specimens are not considered.\n\nThis eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.\n\nThis version of the eCQM uses QDM version 5.6. Please refer to the eCQI resource center (https://ecqi.healthit.gov/qdm) for more information on the QDM.",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "TRANF",
            "value" : "TBD",
            "name" : "Transmission Format",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "TRANF",
                "title" : "Transmission Format"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "TBD",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "IPOP",
            "value" : "Inpatient hospitalizations for patients age 18 and older that end during the measurement period, as well as either: \n\n - A diagnosis of diabetes that starts before or during the encounter; or \n - Administration of at least one dose of insulin or any hypoglycemic medication during the encounter; or \n - Presence of at least one glucose value >=200 mg/dL at any time during the encounter",
            "name" : "Initial Population",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "IPOP",
                "title" : "Initial Population"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Inpatient hospitalizations for patients age 18 and older that end during the measurement period, as well as either: \n\n - A diagnosis of diabetes that starts before or during the encounter; or \n - Administration of at least one dose of insulin or any hypoglycemic medication during the encounter; or \n - Presence of at least one glucose value >=200 mg/dL at any time during the encounter",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "DENOM",
            "value" : "Equals Initial Population",
            "name" : "Denominator",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "DENOM",
                "title" : "Denominator"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Equals Initial Population",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "DENEX",
            "value" : "Inpatient hospitalizations for patients with an initial glucose result of >=1000 mg/dL anytime between 1 hour prior to the start of the encounter to 6 hours after the start of the encounter",
            "name" : "Denominator Exclusions",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "DENEX",
                "title" : "Denominator Exclusions"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Inpatient hospitalizations for patients with an initial glucose result of >=1000 mg/dL anytime between 1 hour prior to the start of the encounter to 6 hours after the start of the encounter",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "NUMER",
            "value" : "Inpatient hospitalizations with a hyperglycemic event within the first 10 days of the encounter minus the first 24 hours, and minus the last period before discharge from the hospital if less than 24 hours\n\nA hyperglycemic event is defined as: \n\n - A day with at least one glucose value >300 mg/dL,\n\nOR\n\n - A day where a glucose test and result was not found, and it was preceded by two consecutive days where \nat least one glucose value during each of the two days was >=200 mg/dL",
            "name" : "Numerator",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "NUMER",
                "title" : "Numerator"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Inpatient hospitalizations with a hyperglycemic event within the first 10 days of the encounter minus the first 24 hours, and minus the last period before discharge from the hospital if less than 24 hours\n\nA hyperglycemic event is defined as: \n\n - A day with at least one glucose value >300 mg/dL,\n\nOR\n\n - A day where a glucose test and result was not found, and it was preceded by two consecutive days where \nat least one glucose value during each of the two days was >=200 mg/dL",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "NUMEX",
            "value" : "Not Applicable",
            "name" : "Numerator Exclusions",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "NUMEX",
                "title" : "Numerator Exclusions"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "Not Applicable",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "MSROBS",
            "value" : "There are two Measure Observations:\n\nMeasure Observation 1, associated with the Denominator: The total number of eligible days of the inpatient hospitalization which match the initial population/denominator criteria and did not meet the denominator exclusion criteria.  \n\nMeasure Observation 2, associated with the Numerator: The total number of hyperglycemic days during the inpatient hospitalization that meet the numerator criteria. Days with a hyperglycemic event are defined as: \n\n - All days with a glucose level >300 mg/dL (except those occurring in the first 24-hour period after \nadmission to the hospital (including the emergency department and observation)), \n\nOR\n\n - All days where a glucose was not measured, and it was preceded by two consecutive days where \nat least one glucose value during each of the two days was >=200 mg/dL.\n\nThe length of stay for all eligible inpatient hospitalizations is truncated to <=10 days when the length exceeds 10 days.\n\nDo not count the last day if it was less than a 24-hour period as this is not considered a full day.",
            "name" : "Measure Observation",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "MSROBS",
                "title" : "Measure Observation"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "There are two Measure Observations:\n\nMeasure Observation 1, associated with the Denominator: The total number of eligible days of the inpatient hospitalization which match the initial population/denominator criteria and did not meet the denominator exclusion criteria.  \n\nMeasure Observation 2, associated with the Numerator: The total number of hyperglycemic days during the inpatient hospitalization that meet the numerator criteria. Days with a hyperglycemic event are defined as: \n\n - All days with a glucose level >300 mg/dL (except those occurring in the first 24-hour period after \nadmission to the hospital (including the emergency department and observation)), \n\nOR\n\n - All days where a glucose was not measured, and it was preceded by two consecutive days where \nat least one glucose value during each of the two days was >=200 mg/dL.\n\nThe length of stay for all eligible inpatient hospitalizations is truncated to <=10 days when the length exceeds 10 days.\n\nDo not count the last day if it was less than a 24-hour period as this is not considered a full day.",
                "media_type" : "text/plain"
            }
        },
        {
            "code" : "SDE",
            "value" : "For every patient evaluated by this measure also identify payer, race, ethnicity and sex",
            "name" : "Supplemental Data Elements",
            "code_obj" : {
                "type" : "CD",
                "system" : "2.16.840.1.113883.5.4",
                "code" : "SDE",
                "title" : "Supplemental Data Elements"
            },
            "value_obj" : {
                "type" : "ED",
                "value" : "For every patient evaluated by this measure also identify payer, race, ethnicity and sex",
                "media_type" : "text/plain"
            }
        }
    ],
    "measure_period" : {
        "type" : "IVL_TS",
        "low" : {
            "type" : "TS",
            "value" : "202301010000",
            "inclusive?" : true,
            "derived?" : false
        },
        "high" : {
            "type" : "TS",
            "value" : "202312312359",
            "inclusive?" : true,
            "derived?" : false
        },
        "width" : {
            "type" : "PQ",
            "unit" : "a",
            "value" : "1",
            "inclusive?" : true,
            "derived?" : false
        }
    },
    "population_criteria" : {
        "OBSERV" : {
            "conjunction?" : false,
            "type" : "OBSERV",
            "hqmf_id" : "EF3028E4-3A9C-4E0C-9519-4F882EF18C0C",
            "aggregator" : "SUM"
        },
        "OBSERV_1" : {
            "conjunction?" : false,
            "type" : "OBSERV",
            "hqmf_id" : "BADA053C-ACB6-4863-8238-F4FADEC14550",
            "aggregator" : "SUM"
        },
        "IPP" : {
            "conjunction?" : true,
            "type" : "IPP",
            "hqmf_id" : "18CA6DFD-F20D-452D-9F10-80908239437A",
            "preconditions" : [
                {
                    "id" : 2,
                    "preconditions" : [
                        {
                            "id" : 1,
                            "reference" : "HospitalHarmHyperglycemiainHospitalizedPatients__Initial_Population__33D5AB83_35E5_4DB8_B086_A149E5C12847"
                        }
                    ],
                    "conjunction_code" : "allTrue"
                }
            ]
        },
        "DENOM" : {
            "conjunction?" : true,
            "type" : "DENOM",
            "hqmf_id" : "5E387CCD-AB40-48EB-984E-BB88A74FA84A",
            "preconditions" : [
                {
                    "id" : 4,
                    "preconditions" : [
                        {
                            "id" : 3,
                            "reference" : "HospitalHarmHyperglycemiainHospitalizedPatients__Denominator__33D5AB83_35E5_4DB8_B086_A149E5C12847"
                        }
                    ],
                    "conjunction_code" : "allTrue"
                }
            ]
        },
        "NUMER" : {
            "conjunction?" : true,
            "type" : "NUMER",
            "hqmf_id" : "B24F213F-485F-4C15-A644-B22AFA73C495",
            "preconditions" : [
                {
                    "id" : 6,
                    "preconditions" : [
                        {
                            "id" : 5,
                            "reference" : "HospitalHarmHyperglycemiainHospitalizedPatients__Numerator__33D5AB83_35E5_4DB8_B086_A149E5C12847"
                        }
                    ],
                    "conjunction_code" : "allTrue"
                }
            ]
        },
        "DENEX" : {
            "conjunction?" : true,
            "type" : "DENEX",
            "hqmf_id" : "B8D56145-B6E6-4A25-8D30-A7D1F18F0587",
            "preconditions" : [
                {
                    "id" : 8,
                    "preconditions" : [
                        {
                            "id" : 7,
                            "reference" : "HospitalHarmHyperglycemiainHospitalizedPatients__Denominator_Exclusions__33D5AB83_35E5_4DB8_B086_A149E5C12847"
                        }
                    ],
                    "conjunction_code" : "atLeastOneTrue"
                }
            ]
        }
    },
    "group_id" : "636a6a04f9a010cc10d95cd6",
    "updated_at" : "2023-03-28T17:52:18.009+0000",
    "created_at" : "2023-03-28T17:52:18.009+0000",
    "cql_libraries" : [
        {
            "_id" : "64232952f9a010eeafc2a054",
            "is_top_level" : true,
            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
            "library_version" : "2.0.027",
            "elm" : {
                "library" : {
                    "annotation" : [
                        {
                            "translatorOptions" : "EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion,DisableMethodInvocation",
                            "type" : "CqlToElmInfo"
                        },
                        {
                            "type" : "Annotation",
                            "s" : {
                                "r" : "541",
                                "s" : [
                                    {
                                        "value" : [
                                            "",
                                            "library HospitalHarmHyperglycemiainHospitalizedPatients version '2.0.027'"
                                        ]
                                    }
                                ]
                            }
                        }
                    ],
                    "identifier" : {
                        "id" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                        "version" : "2.0.027"
                    },
                    "schemaIdentifier" : {
                        "id" : "urn:hl7-org:elm",
                        "version" : "r1"
                    },
                    "usings" : {
                        "def" : [
                            {
                                "localIdentifier" : "System",
                                "uri" : "urn:hl7-org:elm-types:r1"
                            },
                            {
                                "localId" : "1",
                                "locator" : "3:1-3:23",
                                "localIdentifier" : "QDM",
                                "uri" : "urn:healthit-gov:qdm:v5_6",
                                "version" : "5.6",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "1",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "using "
                                                    ]
                                                },
                                                {
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "QDM"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " version ",
                                                        "'5.6'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "includes" : {
                        "def" : [
                            {
                                "localId" : "2",
                                "locator" : "5:1-5:64",
                                "localIdentifier" : "Global",
                                "path" : "MATGlobalCommonFunctions",
                                "version" : "7.0.000",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "2",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "include "
                                                    ]
                                                },
                                                {
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "MATGlobalCommonFunctions"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " version ",
                                                        "'7.0.000'",
                                                        " called ",
                                                        "Global"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "parameters" : {
                        "def" : [
                            {
                                "localId" : "13",
                                "locator" : "16:1-16:49",
                                "name" : "Measurement Period",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "13",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "parameter ",
                                                        "\"Measurement Period\"",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "12",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "11",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "parameterTypeSpecifier" : {
                                    "localId" : "12",
                                    "locator" : "16:32-16:49",
                                    "type" : "IntervalTypeSpecifier",
                                    "pointType" : {
                                        "localId" : "11",
                                        "locator" : "16:41-16:48",
                                        "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                        "type" : "NamedTypeSpecifier"
                                    }
                                }
                            }
                        ]
                    },
                    "valueSets" : {
                        "def" : [
                            {
                                "localId" : "3",
                                "locator" : "7:1-7:71",
                                "name" : "Diabetes",
                                "id" : "2.16.840.1.113883.3.464.1003.103.12.1001",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "3",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Diabetes\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113883.3.464.1003.103.12.1001'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "4",
                                "locator" : "8:1-8:71",
                                "name" : "Encounter Inpatient",
                                "id" : "2.16.840.1.113883.3.666.5.307",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "4",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Encounter Inpatient\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113883.3.666.5.307'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "5",
                                "locator" : "9:1-9:58",
                                "name" : "Ethnicity",
                                "id" : "2.16.840.1.114222.4.11.837",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "5",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Ethnicity\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.114222.4.11.837'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "6",
                                "locator" : "10:1-10:84",
                                "name" : "Glucose Lab Test Mass Per Volume",
                                "id" : "2.16.840.1.113762.1.4.1248.34",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "6",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Glucose Lab Test Mass Per Volume\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113762.1.4.1248.34'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "7",
                                "locator" : "11:1-11:88",
                                "name" : "Hypoglycemics Treatment Medications",
                                "id" : "2.16.840.1.113762.1.4.1196.394",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "7",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Hypoglycemics Treatment Medications\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113762.1.4.1196.394'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "8",
                                "locator" : "12:1-12:68",
                                "name" : "ONC Administrative Sex",
                                "id" : "2.16.840.1.113762.1.4.1",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "8",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"ONC Administrative Sex\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113762.1.4.1'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "9",
                                "locator" : "13:1-13:55",
                                "name" : "Payer",
                                "id" : "2.16.840.1.114222.4.11.3591",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "9",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Payer\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.114222.4.11.3591'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "10",
                                "locator" : "14:1-14:53",
                                "name" : "Race",
                                "id" : "2.16.840.1.114222.4.11.836",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "10",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Race\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.114222.4.11.836'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "contexts" : {
                        "def" : [
                            {
                                "locator" : "18:1-18:15",
                                "name" : "Patient"
                            }
                        ]
                    },
                    "statements" : {
                        "def" : [
                            {
                                "locator" : "18:1-18:15",
                                "name" : "Patient",
                                "context" : "Patient",
                                "expression" : {
                                    "type" : "SingletonFrom",
                                    "operand" : {
                                        "locator" : "18:1-18:15",
                                        "dataType" : "{urn:healthit-gov:qdm:v5_6}Patient",
                                        "templateId" : "Patient",
                                        "type" : "Retrieve"
                                    }
                                }
                            },
                            {
                                "localId" : "29",
                                "locator" : "166:1-169:81",
                                "name" : "Qualifying Encounter",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "29",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Qualifying Encounter\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "28",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "15",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "14",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "14",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Encounter, Performed\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Encounter Inpatient\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "InpatientEncounter"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "27",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "where "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "27",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "19",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "17",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "16",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "InpatientEncounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "17",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "relevantPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "19",
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "ends during day of",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "18",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Measurement Period\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n      and "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "26",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "24",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "AgeInYearsAt",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "23",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "date from "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "22",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "start of "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "21",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "20",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "InpatientEncounter"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "21",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "relevantPeriod"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "25",
                                                                                    "value" : [
                                                                                        ">=",
                                                                                        " ",
                                                                                        "18"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "28",
                                    "locator" : "167:3-169:81",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "15",
                                            "locator" : "167:3-167:68",
                                            "alias" : "InpatientEncounter",
                                            "expression" : {
                                                "localId" : "14",
                                                "locator" : "167:3-167:49",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                "templateId" : "PositiveEncounterPerformed",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "167:28-167:48",
                                                    "name" : "Encounter Inpatient",
                                                    "type" : "ValueSetRef"
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "where" : {
                                        "localId" : "27",
                                        "locator" : "168:5-169:81",
                                        "type" : "And",
                                        "operand" : [
                                            {
                                                "localId" : "19",
                                                "locator" : "168:11-168:83",
                                                "precision" : "Day",
                                                "type" : "In",
                                                "operand" : [
                                                    {
                                                        "locator" : "168:45-168:48",
                                                        "type" : "End",
                                                        "operand" : {
                                                            "localId" : "17",
                                                            "locator" : "168:11-168:43",
                                                            "path" : "relevantPeriod",
                                                            "scope" : "InpatientEncounter",
                                                            "type" : "Property"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "18",
                                                        "locator" : "168:64-168:83",
                                                        "name" : "Measurement Period",
                                                        "type" : "ParameterRef"
                                                    }
                                                ]
                                            },
                                            {
                                                "localId" : "26",
                                                "locator" : "169:11-169:81",
                                                "type" : "GreaterOrEqual",
                                                "operand" : [
                                                    {
                                                        "localId" : "24",
                                                        "locator" : "169:11-169:76",
                                                        "precision" : "Year",
                                                        "type" : "CalculateAgeAt",
                                                        "operand" : [
                                                            {
                                                                "type" : "ToDate",
                                                                "operand" : {
                                                                    "path" : "birthDatetime",
                                                                    "type" : "Property",
                                                                    "source" : {
                                                                        "name" : "Patient",
                                                                        "type" : "ExpressionRef"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "localId" : "23",
                                                                "locator" : "169:24-169:75",
                                                                "type" : "DateFrom",
                                                                "operand" : {
                                                                    "localId" : "22",
                                                                    "locator" : "169:34-169:75",
                                                                    "type" : "Start",
                                                                    "operand" : {
                                                                        "localId" : "21",
                                                                        "locator" : "169:43-169:75",
                                                                        "path" : "relevantPeriod",
                                                                        "scope" : "InpatientEncounter",
                                                                        "type" : "Property"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "localId" : "25",
                                                        "locator" : "169:80-169:81",
                                                        "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                        "value" : "18",
                                                        "type" : "Literal"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            },
                            {
                                "localId" : "39",
                                "locator" : "108:1-113:5",
                                "name" : "Encounter with Hospitalization Period",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "39",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/** Create paring of encounters to hospitalization period so this calculation can be inspected and the result \n * can be reused, making the logic faster.*/",
                                                        "define ",
                                                        "\"Encounter with Hospitalization Period\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "38",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "31",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "30",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Qualifying Encounter\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "QualifyingHospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "37",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "36",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "Tuple {\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "32",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "QualifyingHospitalization"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "hospitalizationPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "35",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "33",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Global"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "35",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"HospitalizationWithObservation\"",
                                                                                                        " ( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "34",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "QualifyingHospitalization"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n    }"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "38",
                                    "locator" : "109:3-113:5",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "31",
                                            "locator" : "109:3-109:50",
                                            "alias" : "QualifyingHospitalization",
                                            "expression" : {
                                                "localId" : "30",
                                                "locator" : "109:3-109:24",
                                                "name" : "Qualifying Encounter",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "37",
                                        "locator" : "110:5-113:5",
                                        "expression" : {
                                            "localId" : "36",
                                            "locator" : "110:12-113:5",
                                            "type" : "Tuple",
                                            "element" : [
                                                {
                                                    "name" : "encounter",
                                                    "value" : {
                                                        "localId" : "32",
                                                        "locator" : "111:18-111:42",
                                                        "name" : "QualifyingHospitalization",
                                                        "type" : "AliasRef"
                                                    }
                                                },
                                                {
                                                    "name" : "hospitalizationPeriod",
                                                    "value" : {
                                                        "localId" : "35",
                                                        "locator" : "112:30-112:98",
                                                        "name" : "HospitalizationWithObservation",
                                                        "libraryName" : "Global",
                                                        "type" : "FunctionRef",
                                                        "operand" : [
                                                            {
                                                                "localId" : "34",
                                                                "locator" : "112:72-112:96",
                                                                "name" : "QualifyingHospitalization",
                                                                "type" : "AliasRef"
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "55",
                                "locator" : "92:1-97:36",
                                "name" : "Encounter with Existing Diabetes Diagnosis",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "55",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/** Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * diabetes and return the encounter.*/",
                                                        "define ",
                                                        "\"Encounter with Existing Diabetes Diagnosis\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "54",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "41",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "40",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Encounter with Hospitalization Period\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "Hospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "50",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "with "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "43",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "42",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "42",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Diagnosis\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Diabetes\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "DiabetesCondition"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n      such that "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "49",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "45",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "44",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "DiabetesCondition"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "45",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "prevalencePeriod"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "49",
                                                                            "value" : [
                                                                                " ",
                                                                                "starts before",
                                                                                " \n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "48",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "end of "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "47",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "46",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Hospitalization"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "47",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "hospitalizationPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "53",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "52",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "51",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Hospitalization"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "52",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "54",
                                    "locator" : "93:3-97:36",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "41",
                                            "locator" : "93:3-93:57",
                                            "alias" : "Hospitalization",
                                            "expression" : {
                                                "localId" : "40",
                                                "locator" : "93:3-93:41",
                                                "name" : "Encounter with Hospitalization Period",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [
                                        {
                                            "localId" : "50",
                                            "locator" : "94:5-96:50",
                                            "alias" : "DiabetesCondition",
                                            "type" : "With",
                                            "expression" : {
                                                "localId" : "42",
                                                "locator" : "94:10-94:34",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}Diagnosis",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "94:24-94:33",
                                                    "name" : "Diabetes",
                                                    "type" : "ValueSetRef"
                                                }
                                            },
                                            "suchThat" : {
                                                "localId" : "49",
                                                "locator" : "95:17-96:50",
                                                "type" : "Before",
                                                "operand" : [
                                                    {
                                                        "locator" : "95:52-95:57",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "45",
                                                            "locator" : "95:17-95:50",
                                                            "path" : "prevalencePeriod",
                                                            "scope" : "DiabetesCondition",
                                                            "type" : "Property"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "48",
                                                        "locator" : "96:7-96:50",
                                                        "type" : "End",
                                                        "operand" : {
                                                            "localId" : "47",
                                                            "locator" : "96:14-96:50",
                                                            "path" : "hospitalizationPeriod",
                                                            "scope" : "Hospitalization",
                                                            "type" : "Property"
                                                        }
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "return" : {
                                        "localId" : "53",
                                        "locator" : "97:5-97:36",
                                        "expression" : {
                                            "localId" : "52",
                                            "locator" : "97:12-97:36",
                                            "path" : "encounter",
                                            "scope" : "Hospitalization",
                                            "type" : "Property"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "75",
                                "locator" : "122:1-126:36",
                                "name" : "Encounter with Hypoglycemic Medication",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "75",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Encounter with Hypoglycemic Medication\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "74",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "58",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "57",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Encounter with Hospitalization Period\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "Hospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "70",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "with "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "60",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "59",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "59",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Medication, Administered\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Hypoglycemics Treatment Medications\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "HypoglycemicMedication"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n      such that "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "69",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "66",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "61",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "66",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"NormalizeInterval\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "63",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "62",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "HypoglycemicMedication"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "63",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantDatetime"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "65",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "64",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "HypoglycemicMedication"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "65",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "69",
                                                                            "value" : [
                                                                                " ",
                                                                                "starts during",
                                                                                " "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "68",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "67",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Hospitalization"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "68",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "hospitalizationPeriod"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "73",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "72",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "71",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Hospitalization"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "72",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "74",
                                    "locator" : "123:3-126:36",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "58",
                                            "locator" : "123:3-123:57",
                                            "alias" : "Hospitalization",
                                            "expression" : {
                                                "localId" : "57",
                                                "locator" : "123:3-123:41",
                                                "name" : "Encounter with Hospitalization Period",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [
                                        {
                                            "localId" : "70",
                                            "locator" : "124:5-125:177",
                                            "alias" : "HypoglycemicMedication",
                                            "type" : "With",
                                            "expression" : {
                                                "localId" : "59",
                                                "locator" : "124:10-124:76",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveMedicationAdministered",
                                                "templateId" : "PositiveMedicationAdministered",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "124:39-124:75",
                                                    "name" : "Hypoglycemics Treatment Medications",
                                                    "type" : "ValueSetRef"
                                                }
                                            },
                                            "suchThat" : {
                                                "localId" : "69",
                                                "locator" : "125:17-125:177",
                                                "type" : "In",
                                                "operand" : [
                                                    {
                                                        "locator" : "125:127-125:132",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "66",
                                                            "locator" : "125:17-125:125",
                                                            "name" : "NormalizeInterval",
                                                            "libraryName" : "Global",
                                                            "type" : "FunctionRef",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "63",
                                                                    "locator" : "125:46-125:84",
                                                                    "path" : "relevantDatetime",
                                                                    "scope" : "HypoglycemicMedication",
                                                                    "type" : "Property"
                                                                },
                                                                {
                                                                    "localId" : "65",
                                                                    "locator" : "125:87-125:123",
                                                                    "path" : "relevantPeriod",
                                                                    "scope" : "HypoglycemicMedication",
                                                                    "type" : "Property"
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    {
                                                        "localId" : "68",
                                                        "locator" : "125:141-125:177",
                                                        "path" : "hospitalizationPeriod",
                                                        "scope" : "Hospitalization",
                                                        "type" : "Property"
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "return" : {
                                        "localId" : "73",
                                        "locator" : "126:5-126:36",
                                        "expression" : {
                                            "localId" : "72",
                                            "locator" : "126:12-126:36",
                                            "path" : "encounter",
                                            "scope" : "Hospitalization",
                                            "type" : "Property"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "101",
                                "locator" : "83:1-88:36",
                                "name" : "Encounter with Elevated Glucose Greater Than or Equal to 200",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "101",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/** Using the already calculated pairing of hospitalization periods with encounters, filter on ones with any elevated (>= 200) glucose reading during the hospitalization **/",
                                                        "define ",
                                                        "\"Encounter with Elevated Glucose Greater Than or Equal to 200\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "100",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "79",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "78",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Encounter with Hospitalization Period\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "Hospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "96",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "with "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "81",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "80",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "80",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Laboratory Test, Performed\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Glucose Lab Test Mass Per Volume\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "GlucoseTest"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n      such that "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "95",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "90",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "87",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "82",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Global"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "87",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"EarliestOf\"",
                                                                                                        " ( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "84",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "83",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "GlucoseTest"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "84",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantDatetime"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ", "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "86",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "85",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "GlucoseTest"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "86",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "90",
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "during",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "89",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "88",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Hospitalization"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "89",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "hospitalizationPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n        and "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "94",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "92",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "91",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "GlucoseTest"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "92",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "result"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        ">=",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "93",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "200 ",
                                                                                                "'mg/dL'"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "99",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "98",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "97",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Hospitalization"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "98",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "100",
                                    "locator" : "84:3-88:36",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "79",
                                            "locator" : "84:3-84:57",
                                            "alias" : "Hospitalization",
                                            "expression" : {
                                                "localId" : "78",
                                                "locator" : "84:3-84:41",
                                                "name" : "Encounter with Hospitalization Period",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [
                                        {
                                            "localId" : "96",
                                            "locator" : "85:5-87:45",
                                            "alias" : "GlucoseTest",
                                            "type" : "With",
                                            "expression" : {
                                                "localId" : "80",
                                                "locator" : "85:10-85:75",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveLaboratoryTestPerformed",
                                                "templateId" : "PositiveLaboratoryTestPerformed",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "85:41-85:74",
                                                    "name" : "Glucose Lab Test Mass Per Volume",
                                                    "type" : "ValueSetRef"
                                                }
                                            },
                                            "suchThat" : {
                                                "localId" : "95",
                                                "locator" : "86:17-87:45",
                                                "type" : "And",
                                                "operand" : [
                                                    {
                                                        "localId" : "90",
                                                        "locator" : "86:17-86:141",
                                                        "type" : "In",
                                                        "operand" : [
                                                            {
                                                                "localId" : "87",
                                                                "locator" : "86:17-86:96",
                                                                "name" : "EarliestOf",
                                                                "libraryName" : "Global",
                                                                "type" : "FunctionRef",
                                                                "operand" : [
                                                                    {
                                                                        "localId" : "84",
                                                                        "locator" : "86:39-86:66",
                                                                        "path" : "relevantDatetime",
                                                                        "scope" : "GlucoseTest",
                                                                        "type" : "Property"
                                                                    },
                                                                    {
                                                                        "localId" : "86",
                                                                        "locator" : "86:69-86:94",
                                                                        "path" : "relevantPeriod",
                                                                        "scope" : "GlucoseTest",
                                                                        "type" : "Property"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "localId" : "89",
                                                                "locator" : "86:105-86:141",
                                                                "path" : "hospitalizationPeriod",
                                                                "scope" : "Hospitalization",
                                                                "type" : "Property"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "localId" : "94",
                                                        "locator" : "87:13-87:45",
                                                        "type" : "GreaterOrEqual",
                                                        "operand" : [
                                                            {
                                                                "asType" : "{urn:hl7-org:elm-types:r1}Quantity",
                                                                "type" : "As",
                                                                "operand" : {
                                                                    "localId" : "92",
                                                                    "locator" : "87:13-87:30",
                                                                    "path" : "result",
                                                                    "scope" : "GlucoseTest",
                                                                    "type" : "Property"
                                                                }
                                                            },
                                                            {
                                                                "localId" : "93",
                                                                "locator" : "87:35-87:45",
                                                                "value" : 200,
                                                                "unit" : "mg/dL",
                                                                "type" : "Quantity"
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "return" : {
                                        "localId" : "99",
                                        "locator" : "88:5-88:36",
                                        "expression" : {
                                            "localId" : "98",
                                            "locator" : "88:12-88:36",
                                            "path" : "encounter",
                                            "scope" : "Hospitalization",
                                            "type" : "Property"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "104",
                                "locator" : "155:1-158:72",
                                "name" : "Initial Population",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "104",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Initial Population\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "103",
                                                    "s" : [
                                                        {
                                                            "r" : "77",
                                                            "s" : [
                                                                {
                                                                    "r" : "56",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "\"Encounter with Existing Diabetes Diagnosis\""
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n    union "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "76",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "\"Encounter with Hypoglycemic Medication\""
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    union "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "102",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"Encounter with Elevated Glucose Greater Than or Equal to 200\""
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "103",
                                    "locator" : "156:3-158:72",
                                    "type" : "Union",
                                    "operand" : [
                                        {
                                            "localId" : "77",
                                            "locator" : "156:3-157:50",
                                            "type" : "Union",
                                            "operand" : [
                                                {
                                                    "localId" : "56",
                                                    "locator" : "156:3-156:46",
                                                    "name" : "Encounter with Existing Diabetes Diagnosis",
                                                    "type" : "ExpressionRef"
                                                },
                                                {
                                                    "localId" : "76",
                                                    "locator" : "157:11-157:50",
                                                    "name" : "Encounter with Hypoglycemic Medication",
                                                    "type" : "ExpressionRef"
                                                }
                                            ]
                                        },
                                        {
                                            "localId" : "102",
                                            "locator" : "158:11-158:72",
                                            "name" : "Encounter with Elevated Glucose Greater Than or Equal to 200",
                                            "type" : "ExpressionRef"
                                        }
                                    ]
                                }
                            },
                            {
                                "localId" : "106",
                                "locator" : "76:1-77:22",
                                "name" : "Denominator",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "106",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Denominator\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "105",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Initial Population\""
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "105",
                                    "locator" : "77:3-77:22",
                                    "name" : "Initial Population",
                                    "type" : "ExpressionRef"
                                }
                            },
                            {
                                "localId" : "108",
                                "locator" : "160:1-161:15",
                                "name" : "Measurement Population",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "108",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Measurement Population\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "107",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Denominator\""
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "107",
                                    "locator" : "161:3-161:15",
                                    "name" : "Denominator",
                                    "type" : "ExpressionRef"
                                }
                            },
                            {
                                "localId" : "129",
                                "locator" : "193:1-196:4",
                                "name" : "Hospital Days Max 10",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "129",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/**\n * Crops an interval to a maximum length of 10 days.*/",
                                                        "define function ",
                                                        "\"Hospital Days Max 10\"",
                                                        "(",
                                                        "Period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "117",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "116",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "128",
                                                    "s" : [
                                                        {
                                                            "r" : "128",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "Interval["
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "119",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "start of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "118",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ", "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "127",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "Min",
                                                                                "("
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "126",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "{ \n    "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "121",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "end of "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "120",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Period"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ", "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "125",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "123",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "122",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " + "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "124",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "10 ",
                                                                                                        "days"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " }"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n  )"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "]"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "128",
                                    "locator" : "194:3-196:4",
                                    "lowClosed" : true,
                                    "highClosed" : true,
                                    "type" : "Interval",
                                    "low" : {
                                        "localId" : "119",
                                        "locator" : "194:12-194:26",
                                        "type" : "Start",
                                        "operand" : {
                                            "localId" : "118",
                                            "locator" : "194:21-194:26",
                                            "name" : "Period",
                                            "type" : "OperandRef"
                                        }
                                    },
                                    "high" : {
                                        "localId" : "127",
                                        "locator" : "194:29-196:3",
                                        "type" : "Min",
                                        "source" : {
                                            "localId" : "126",
                                            "locator" : "194:33-195:46",
                                            "type" : "List",
                                            "element" : [
                                                {
                                                    "localId" : "121",
                                                    "locator" : "195:5-195:17",
                                                    "type" : "End",
                                                    "operand" : {
                                                        "localId" : "120",
                                                        "locator" : "195:12-195:17",
                                                        "name" : "Period",
                                                        "type" : "OperandRef"
                                                    }
                                                },
                                                {
                                                    "localId" : "125",
                                                    "locator" : "195:20-195:44",
                                                    "type" : "Add",
                                                    "operand" : [
                                                        {
                                                            "localId" : "123",
                                                            "locator" : "195:20-195:34",
                                                            "type" : "Start",
                                                            "operand" : {
                                                                "localId" : "122",
                                                                "locator" : "195:29-195:34",
                                                                "name" : "Period",
                                                                "type" : "OperandRef"
                                                            }
                                                        },
                                                        {
                                                            "localId" : "124",
                                                            "locator" : "195:38-195:44",
                                                            "value" : 10,
                                                            "unit" : "days",
                                                            "type" : "Quantity"
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "117",
                                            "locator" : "193:47-193:64",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "116",
                                                "locator" : "193:56-193:63",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "155",
                                "locator" : "185:1-189:20",
                                "name" : "Interval To Day Numbers",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "155",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/** Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\n * the final day if it is less than 24 hours. This also includes the first 24 hour period.*/",
                                                        "define function ",
                                                        "\"Interval To Day Numbers\"",
                                                        "(",
                                                        "Period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "140",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "139",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "154",
                                                    "s" : [
                                                        {
                                                            "r" : "154",
                                                            "s" : [
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "r" : "150",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "149",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "149",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "expand "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "148",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "{ "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "147",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "141",
                                                                                                                    "value" : [
                                                                                                                        "Interval[",
                                                                                                                        "1",
                                                                                                                        ", "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "146",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "days between "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "143",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "start of "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "142",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "Period"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " and \n  "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "145",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "end of "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "144",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "Period"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "]"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "}"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "DayExpand"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "153",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "return \n    "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "152",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "end of "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "151",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "DayExpand"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "154",
                                    "locator" : "186:3-189:20",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "150",
                                            "locator" : "186:3-187:29",
                                            "alias" : "DayExpand",
                                            "expression" : {
                                                "localId" : "149",
                                                "locator" : "186:3-187:19",
                                                "type" : "Expand",
                                                "operand" : [
                                                    {
                                                        "localId" : "148",
                                                        "locator" : "186:12-187:17",
                                                        "type" : "List",
                                                        "element" : [
                                                            {
                                                                "localId" : "147",
                                                                "locator" : "186:14-187:16",
                                                                "lowClosed" : true,
                                                                "highClosed" : true,
                                                                "type" : "Interval",
                                                                "low" : {
                                                                    "localId" : "141",
                                                                    "locator" : "186:23",
                                                                    "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                                    "value" : "1",
                                                                    "type" : "Literal"
                                                                },
                                                                "high" : {
                                                                    "localId" : "146",
                                                                    "locator" : "186:26-187:15",
                                                                    "precision" : "Day",
                                                                    "type" : "DurationBetween",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "143",
                                                                            "locator" : "186:39-186:53",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "142",
                                                                                "locator" : "186:48-186:53",
                                                                                "name" : "Period",
                                                                                "type" : "OperandRef"
                                                                            }
                                                                        },
                                                                        {
                                                                            "localId" : "145",
                                                                            "locator" : "187:3-187:15",
                                                                            "type" : "End",
                                                                            "operand" : {
                                                                                "localId" : "144",
                                                                                "locator" : "187:10-187:15",
                                                                                "name" : "Period",
                                                                                "type" : "OperandRef"
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity",
                                                        "type" : "Null"
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "153",
                                        "locator" : "188:5-189:20",
                                        "expression" : {
                                            "localId" : "152",
                                            "locator" : "189:5-189:20",
                                            "type" : "End",
                                            "operand" : {
                                                "localId" : "151",
                                                "locator" : "189:12-189:20",
                                                "name" : "DayExpand",
                                                "type" : "AliasRef"
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "140",
                                            "locator" : "185:50-185:67",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "139",
                                                "locator" : "185:59-185:66",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "189",
                                "locator" : "200:1-210:5",
                                "name" : "Days In Period",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "189",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/**\n * Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.*/",
                                                        "define function ",
                                                        "\"Days In Period\"",
                                                        "(",
                                                        "Period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "137",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "136",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "188",
                                                    "s" : [
                                                        {
                                                            "r" : "188",
                                                            "s" : [
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "r" : "157",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "156",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "156",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Interval To Day Numbers\"",
                                                                                                        "("
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "138",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ")"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "DayNumber"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "let "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "166",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "startPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "165",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "159",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "158",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " + "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "164",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "164",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "160",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "24 ",
                                                                                                                        "hours"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " * "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "163",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "( "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "163",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "161",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "DayNumber"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "162",
                                                                                                                            "value" : [
                                                                                                                                " - ",
                                                                                                                                "1"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " )"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n    "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "181",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "endPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "180",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "if "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "172",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "172",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "170",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "hours between "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "167",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "startPeriod"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " and \n      "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "169",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "168",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "Period"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "171",
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "<",
                                                                                                                " ",
                                                                                                                "24"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n    )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " then "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "173",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "startPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " \n      else "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "179",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "175",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "start of "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "174",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Period"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " + "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "178",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "( "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "178",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "176",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "24 ",
                                                                                                                                "hours"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " * "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "177",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "DayNumber"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " )"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "187",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "return "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "186",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Tuple {\n      "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "dayNumber",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "182",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "DayNumber"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ",\n      "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "dayPeriod",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "185",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Interval["
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "183",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "startPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ", "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "184",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "endPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n    }"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "188",
                                    "locator" : "201:3-210:5",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "157",
                                            "locator" : "201:3-201:48",
                                            "alias" : "DayNumber",
                                            "expression" : {
                                                "localId" : "156",
                                                "locator" : "201:3-201:38",
                                                "name" : "Interval To Day Numbers",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "138",
                                                        "locator" : "201:31-201:36",
                                                        "name" : "Period",
                                                        "type" : "OperandRef"
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "166",
                                            "locator" : "202:9-202:71",
                                            "identifier" : "startPeriod",
                                            "expression" : {
                                                "localId" : "165",
                                                "locator" : "202:22-202:71",
                                                "type" : "Add",
                                                "operand" : [
                                                    {
                                                        "localId" : "159",
                                                        "locator" : "202:22-202:36",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "158",
                                                            "locator" : "202:31-202:36",
                                                            "name" : "Period",
                                                            "type" : "OperandRef"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "164",
                                                        "locator" : "202:40-202:71",
                                                        "type" : "Multiply",
                                                        "operand" : [
                                                            {
                                                                "localId" : "160",
                                                                "locator" : "202:42-202:49",
                                                                "value" : 24,
                                                                "unit" : "hours",
                                                                "type" : "Quantity"
                                                            },
                                                            {
                                                                "type" : "ToQuantity",
                                                                "operand" : {
                                                                    "localId" : "163",
                                                                    "locator" : "202:53-202:69",
                                                                    "type" : "Subtract",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "161",
                                                                            "locator" : "202:55-202:63",
                                                                            "name" : "DayNumber",
                                                                            "type" : "AliasRef"
                                                                        },
                                                                        {
                                                                            "localId" : "162",
                                                                            "locator" : "202:67",
                                                                            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                                            "value" : "1",
                                                                            "type" : "Literal"
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "181",
                                            "locator" : "203:5-206:53",
                                            "identifier" : "endPeriod",
                                            "expression" : {
                                                "localId" : "180",
                                                "locator" : "203:16-206:53",
                                                "type" : "If",
                                                "condition" : {
                                                    "localId" : "172",
                                                    "locator" : "203:19-205:5",
                                                    "type" : "Less",
                                                    "operand" : [
                                                        {
                                                            "localId" : "170",
                                                            "locator" : "203:21-204:19",
                                                            "precision" : "Hour",
                                                            "type" : "DurationBetween",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "167",
                                                                    "locator" : "203:35-203:45",
                                                                    "name" : "startPeriod",
                                                                    "type" : "QueryLetRef"
                                                                },
                                                                {
                                                                    "localId" : "169",
                                                                    "locator" : "204:7-204:19",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "168",
                                                                        "locator" : "204:14-204:19",
                                                                        "name" : "Period",
                                                                        "type" : "OperandRef"
                                                                    }
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "localId" : "171",
                                                            "locator" : "204:23-204:24",
                                                            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                            "value" : "24",
                                                            "type" : "Literal"
                                                        }
                                                    ]
                                                },
                                                "then" : {
                                                    "localId" : "173",
                                                    "locator" : "205:12-205:22",
                                                    "name" : "startPeriod",
                                                    "type" : "QueryLetRef"
                                                },
                                                "else" : {
                                                    "localId" : "179",
                                                    "locator" : "206:12-206:53",
                                                    "type" : "Add",
                                                    "operand" : [
                                                        {
                                                            "localId" : "175",
                                                            "locator" : "206:12-206:26",
                                                            "type" : "Start",
                                                            "operand" : {
                                                                "localId" : "174",
                                                                "locator" : "206:21-206:26",
                                                                "name" : "Period",
                                                                "type" : "OperandRef"
                                                            }
                                                        },
                                                        {
                                                            "localId" : "178",
                                                            "locator" : "206:30-206:53",
                                                            "type" : "Multiply",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "176",
                                                                    "locator" : "206:32-206:39",
                                                                    "value" : 24,
                                                                    "unit" : "hours",
                                                                    "type" : "Quantity"
                                                                },
                                                                {
                                                                    "type" : "ToQuantity",
                                                                    "operand" : {
                                                                        "localId" : "177",
                                                                        "locator" : "206:43-206:51",
                                                                        "name" : "DayNumber",
                                                                        "type" : "AliasRef"
                                                                    }
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "187",
                                        "locator" : "207:5-210:5",
                                        "expression" : {
                                            "localId" : "186",
                                            "locator" : "207:12-210:5",
                                            "type" : "Tuple",
                                            "element" : [
                                                {
                                                    "name" : "dayNumber",
                                                    "value" : {
                                                        "localId" : "182",
                                                        "locator" : "208:18-208:26",
                                                        "name" : "DayNumber",
                                                        "type" : "AliasRef"
                                                    }
                                                },
                                                {
                                                    "name" : "dayPeriod",
                                                    "value" : {
                                                        "localId" : "185",
                                                        "locator" : "209:18-209:50",
                                                        "lowClosed" : true,
                                                        "highClosed" : false,
                                                        "type" : "Interval",
                                                        "low" : {
                                                            "localId" : "183",
                                                            "locator" : "209:27-209:37",
                                                            "name" : "startPeriod",
                                                            "type" : "QueryLetRef"
                                                        },
                                                        "high" : {
                                                            "localId" : "184",
                                                            "locator" : "209:40-209:48",
                                                            "name" : "endPeriod",
                                                            "type" : "QueryLetRef"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "137",
                                            "locator" : "200:41-200:58",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "136",
                                                "locator" : "200:50-200:57",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "194",
                                "locator" : "20:1-29:5",
                                "name" : "Days in Hospitalization",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "194",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Days in Hospitalization\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "193",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "110",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "109",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Measurement Population\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "EligibleInpatientHospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "let "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "114",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "period",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "113",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "111",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "113",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"HospitalizationWithObservation\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "112",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EligibleInpatientHospitalization"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "131",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "relevantPeriod",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "130",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "\"Hospital Days Max 10\"",
                                                                                        "("
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "115",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ")"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "192",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "191",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "Tuple {\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "132",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "EligibleInpatientHospitalization"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "hospitalizationPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "133",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "relevantPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "134",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "relevantPeriod"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "relevantDays",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "190",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Days In Period\"",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "135",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "relevantPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n    }"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "193",
                                    "locator" : "21:3-29:5",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "110",
                                            "locator" : "21:3-21:59",
                                            "alias" : "EligibleInpatientHospitalization",
                                            "expression" : {
                                                "localId" : "109",
                                                "locator" : "21:3-21:26",
                                                "name" : "Measurement Population",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "114",
                                            "locator" : "22:9-22:92",
                                            "identifier" : "period",
                                            "expression" : {
                                                "localId" : "113",
                                                "locator" : "22:17-22:92",
                                                "name" : "HospitalizationWithObservation",
                                                "libraryName" : "Global",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "112",
                                                        "locator" : "22:59-22:90",
                                                        "name" : "EligibleInpatientHospitalization",
                                                        "type" : "AliasRef"
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "131",
                                            "locator" : "23:5-23:50",
                                            "identifier" : "relevantPeriod",
                                            "expression" : {
                                                "localId" : "130",
                                                "locator" : "23:21-23:50",
                                                "name" : "Hospital Days Max 10",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "115",
                                                        "locator" : "23:44-23:49",
                                                        "name" : "period",
                                                        "type" : "QueryLetRef"
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "192",
                                        "locator" : "24:5-29:5",
                                        "expression" : {
                                            "localId" : "191",
                                            "locator" : "24:12-29:5",
                                            "type" : "Tuple",
                                            "element" : [
                                                {
                                                    "name" : "encounter",
                                                    "value" : {
                                                        "localId" : "132",
                                                        "locator" : "25:18-25:49",
                                                        "name" : "EligibleInpatientHospitalization",
                                                        "type" : "AliasRef"
                                                    }
                                                },
                                                {
                                                    "name" : "hospitalizationPeriod",
                                                    "value" : {
                                                        "localId" : "133",
                                                        "locator" : "26:30-26:35",
                                                        "name" : "period",
                                                        "type" : "QueryLetRef"
                                                    }
                                                },
                                                {
                                                    "name" : "relevantPeriod",
                                                    "value" : {
                                                        "localId" : "134",
                                                        "locator" : "27:23-27:36",
                                                        "name" : "relevantPeriod",
                                                        "type" : "QueryLetRef"
                                                    }
                                                },
                                                {
                                                    "name" : "relevantDays",
                                                    "value" : {
                                                        "localId" : "190",
                                                        "locator" : "28:21-28:52",
                                                        "name" : "Days In Period",
                                                        "type" : "FunctionRef",
                                                        "operand" : [
                                                            {
                                                                "localId" : "135",
                                                                "locator" : "28:38-28:51",
                                                                "name" : "relevantPeriod",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "263",
                                "locator" : "31:1-53:5",
                                "name" : "Days with Glucose Results",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "263",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Days with Glucose Results\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "262",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "196",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "195",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Days in Hospitalization\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "InpatientHospitalDays"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "261",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "260",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "Tuple {\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "198",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "197",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "InpatientHospitalDays"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "198",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "encounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "relevantPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "200",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "199",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "InpatientHospitalDays"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "200",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "relevantPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "relevantDays",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "259",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "259",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "202",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "201",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "InpatientHospitalDays",
                                                                                                                                        ".",
                                                                                                                                        "relevantDays"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "EncounterDay"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n          "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "258",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "return "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "257",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Tuple {\n            "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "dayNumber",
                                                                                                                                ": "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "204",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "203",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "EncounterDay"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "204",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "dayNumber"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ",\n            "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "dayPeriod",
                                                                                                                                ": "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "206",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "205",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "EncounterDay"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "206",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "dayPeriod"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ",\n            "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "hasSevereResult",
                                                                                                                                ": "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "224",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "exists "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "223",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "( "
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "r" : "223",
                                                                                                                                            "s" : [
                                                                                                                                                {
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "r" : "208",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "207",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "207",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "[",
                                                                                                                                                                                        "\"Laboratory Test, Performed\"",
                                                                                                                                                                                        ": "
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "\"Glucose Lab Test Mass Per Volume\""
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "]"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        " ",
                                                                                                                                                                        "GlucoseTest"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "\n                "
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "r" : "222",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "where "
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "r" : "222",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "212",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "210",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "209",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "210",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "result"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " ",
                                                                                                                                                                                ">",
                                                                                                                                                                                " "
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "211",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "300 ",
                                                                                                                                                                                        "'mg/dL'"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "\n                  and "
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "r" : "221",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "218",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "213",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "Global"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "218",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "\"EarliestOf\"",
                                                                                                                                                                                                " ( "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "r" : "215",
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "214",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "."
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "215",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "relevantDatetime"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                ", "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "r" : "217",
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "216",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "."
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "217",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "relevantPeriod"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                " )"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "221",
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " ",
                                                                                                                                                                                "during",
                                                                                                                                                                                " "
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "220",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "219",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "EncounterDay"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "220",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "dayPeriod"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\n            )"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ",\n            "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "hasElevatedResult",
                                                                                                                                ": "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "242",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "exists "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "241",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "( "
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "r" : "241",
                                                                                                                                            "s" : [
                                                                                                                                                {
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "r" : "226",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "225",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "225",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "[",
                                                                                                                                                                                        "\"Laboratory Test, Performed\"",
                                                                                                                                                                                        ": "
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "\"Glucose Lab Test Mass Per Volume\""
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "]"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        " ",
                                                                                                                                                                        "GlucoseTest"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "\n                "
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "r" : "240",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "where "
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "r" : "240",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "230",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "228",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "227",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "228",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "result"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " ",
                                                                                                                                                                                ">=",
                                                                                                                                                                                " "
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "229",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "200 ",
                                                                                                                                                                                        "'mg/dL'"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "\n                  and "
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "r" : "239",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "236",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "231",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "Global"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "236",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "\"EarliestOf\"",
                                                                                                                                                                                                " ( "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "r" : "233",
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "232",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "."
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "233",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "relevantDatetime"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                ", "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "r" : "235",
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "234",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "."
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "235",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "relevantPeriod"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                " )"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "239",
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " ",
                                                                                                                                                                                "during",
                                                                                                                                                                                " "
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "238",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "237",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "EncounterDay"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "238",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "dayPeriod"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\n            )"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ",\n            "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "hasNoGlucoseTest",
                                                                                                                                ": "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "256",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "not "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "255",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "exists "
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "r" : "254",
                                                                                                                                            "s" : [
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "( "
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "r" : "254",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "244",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "243",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "243",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "[",
                                                                                                                                                                                                "\"Laboratory Test, Performed\"",
                                                                                                                                                                                                ": "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "\"Glucose Lab Test Mass Per Volume\""
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "]"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " ",
                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "\n                "
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "r" : "253",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "where "
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "r" : "253",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "250",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "245",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "Global"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "250",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "\"EarliestOf\"",
                                                                                                                                                                                                " ( "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "r" : "247",
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "246",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "."
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "247",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "relevantDatetime"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                ", "
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "r" : "249",
                                                                                                                                                                                            "s" : [
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "248",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "GlucoseTest"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "value" : [
                                                                                                                                                                                                        "."
                                                                                                                                                                                                    ]
                                                                                                                                                                                                },
                                                                                                                                                                                                {
                                                                                                                                                                                                    "r" : "249",
                                                                                                                                                                                                    "s" : [
                                                                                                                                                                                                        {
                                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                                "relevantPeriod"
                                                                                                                                                                                                            ]
                                                                                                                                                                                                        }
                                                                                                                                                                                                    ]
                                                                                                                                                                                                }
                                                                                                                                                                                            ]
                                                                                                                                                                                        },
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                " )"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "253",
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " ",
                                                                                                                                                                                "during",
                                                                                                                                                                                " "
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "252",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "251",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "EncounterDay"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "252",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "dayPeriod"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "\n            )"
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "\n          }"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n    }"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "262",
                                    "locator" : "32:3-53:5",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "196",
                                            "locator" : "32:3-32:49",
                                            "alias" : "InpatientHospitalDays",
                                            "expression" : {
                                                "localId" : "195",
                                                "locator" : "32:3-32:27",
                                                "name" : "Days in Hospitalization",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "261",
                                        "locator" : "33:5-53:5",
                                        "expression" : {
                                            "localId" : "260",
                                            "locator" : "33:12-53:5",
                                            "type" : "Tuple",
                                            "element" : [
                                                {
                                                    "name" : "encounter",
                                                    "value" : {
                                                        "localId" : "198",
                                                        "locator" : "34:18-34:48",
                                                        "path" : "encounter",
                                                        "scope" : "InpatientHospitalDays",
                                                        "type" : "Property"
                                                    }
                                                },
                                                {
                                                    "name" : "relevantPeriod",
                                                    "value" : {
                                                        "localId" : "200",
                                                        "locator" : "35:23-35:58",
                                                        "path" : "relevantPeriod",
                                                        "scope" : "InpatientHospitalDays",
                                                        "type" : "Property"
                                                    }
                                                },
                                                {
                                                    "name" : "relevantDays",
                                                    "value" : {
                                                        "localId" : "259",
                                                        "locator" : "36:21-52:7",
                                                        "type" : "Query",
                                                        "source" : [
                                                            {
                                                                "localId" : "202",
                                                                "locator" : "36:23-36:69",
                                                                "alias" : "EncounterDay",
                                                                "expression" : {
                                                                    "localId" : "201",
                                                                    "locator" : "36:23-36:56",
                                                                    "path" : "relevantDays",
                                                                    "scope" : "InpatientHospitalDays",
                                                                    "type" : "Property"
                                                                }
                                                            }
                                                        ],
                                                        "relationship" : [

                                                        ],
                                                        "return" : {
                                                            "localId" : "258",
                                                            "locator" : "37:11-51:11",
                                                            "expression" : {
                                                                "localId" : "257",
                                                                "locator" : "37:18-51:11",
                                                                "type" : "Tuple",
                                                                "element" : [
                                                                    {
                                                                        "name" : "dayNumber",
                                                                        "value" : {
                                                                            "localId" : "204",
                                                                            "locator" : "38:24-38:45",
                                                                            "path" : "dayNumber",
                                                                            "scope" : "EncounterDay",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "name" : "dayPeriod",
                                                                        "value" : {
                                                                            "localId" : "206",
                                                                            "locator" : "39:24-39:45",
                                                                            "path" : "dayPeriod",
                                                                            "scope" : "EncounterDay",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "name" : "hasSevereResult",
                                                                        "value" : {
                                                                            "localId" : "224",
                                                                            "locator" : "40:30-43:13",
                                                                            "type" : "Exists",
                                                                            "operand" : {
                                                                                "localId" : "223",
                                                                                "locator" : "40:37-43:13",
                                                                                "type" : "Query",
                                                                                "source" : [
                                                                                    {
                                                                                        "localId" : "208",
                                                                                        "locator" : "40:39-40:116",
                                                                                        "alias" : "GlucoseTest",
                                                                                        "expression" : {
                                                                                            "localId" : "207",
                                                                                            "locator" : "40:39-40:104",
                                                                                            "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveLaboratoryTestPerformed",
                                                                                            "templateId" : "PositiveLaboratoryTestPerformed",
                                                                                            "codeProperty" : "code",
                                                                                            "codeComparator" : "in",
                                                                                            "type" : "Retrieve",
                                                                                            "codes" : {
                                                                                                "locator" : "40:70-40:103",
                                                                                                "name" : "Glucose Lab Test Mass Per Volume",
                                                                                                "type" : "ValueSetRef"
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                ],
                                                                                "relationship" : [

                                                                                ],
                                                                                "where" : {
                                                                                    "localId" : "222",
                                                                                    "locator" : "41:17-42:132",
                                                                                    "type" : "And",
                                                                                    "operand" : [
                                                                                        {
                                                                                            "localId" : "212",
                                                                                            "locator" : "41:23-41:54",
                                                                                            "type" : "Greater",
                                                                                            "operand" : [
                                                                                                {
                                                                                                    "asType" : "{urn:hl7-org:elm-types:r1}Quantity",
                                                                                                    "type" : "As",
                                                                                                    "operand" : {
                                                                                                        "localId" : "210",
                                                                                                        "locator" : "41:23-41:40",
                                                                                                        "path" : "result",
                                                                                                        "scope" : "GlucoseTest",
                                                                                                        "type" : "Property"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "localId" : "211",
                                                                                                    "locator" : "41:44-41:54",
                                                                                                    "value" : 300,
                                                                                                    "unit" : "mg/dL",
                                                                                                    "type" : "Quantity"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "localId" : "221",
                                                                                            "locator" : "42:23-42:132",
                                                                                            "type" : "In",
                                                                                            "operand" : [
                                                                                                {
                                                                                                    "localId" : "218",
                                                                                                    "locator" : "42:23-42:102",
                                                                                                    "name" : "EarliestOf",
                                                                                                    "libraryName" : "Global",
                                                                                                    "type" : "FunctionRef",
                                                                                                    "operand" : [
                                                                                                        {
                                                                                                            "localId" : "215",
                                                                                                            "locator" : "42:45-42:72",
                                                                                                            "path" : "relevantDatetime",
                                                                                                            "scope" : "GlucoseTest",
                                                                                                            "type" : "Property"
                                                                                                        },
                                                                                                        {
                                                                                                            "localId" : "217",
                                                                                                            "locator" : "42:75-42:100",
                                                                                                            "path" : "relevantPeriod",
                                                                                                            "scope" : "GlucoseTest",
                                                                                                            "type" : "Property"
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "localId" : "220",
                                                                                                    "locator" : "42:111-42:132",
                                                                                                    "path" : "dayPeriod",
                                                                                                    "scope" : "EncounterDay",
                                                                                                    "type" : "Property"
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            }
                                                                        }
                                                                    },
                                                                    {
                                                                        "name" : "hasElevatedResult",
                                                                        "value" : {
                                                                            "localId" : "242",
                                                                            "locator" : "44:32-47:13",
                                                                            "type" : "Exists",
                                                                            "operand" : {
                                                                                "localId" : "241",
                                                                                "locator" : "44:39-47:13",
                                                                                "type" : "Query",
                                                                                "source" : [
                                                                                    {
                                                                                        "localId" : "226",
                                                                                        "locator" : "44:41-44:118",
                                                                                        "alias" : "GlucoseTest",
                                                                                        "expression" : {
                                                                                            "localId" : "225",
                                                                                            "locator" : "44:41-44:106",
                                                                                            "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveLaboratoryTestPerformed",
                                                                                            "templateId" : "PositiveLaboratoryTestPerformed",
                                                                                            "codeProperty" : "code",
                                                                                            "codeComparator" : "in",
                                                                                            "type" : "Retrieve",
                                                                                            "codes" : {
                                                                                                "locator" : "44:72-44:105",
                                                                                                "name" : "Glucose Lab Test Mass Per Volume",
                                                                                                "type" : "ValueSetRef"
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                ],
                                                                                "relationship" : [

                                                                                ],
                                                                                "where" : {
                                                                                    "localId" : "240",
                                                                                    "locator" : "45:17-46:132",
                                                                                    "type" : "And",
                                                                                    "operand" : [
                                                                                        {
                                                                                            "localId" : "230",
                                                                                            "locator" : "45:23-45:55",
                                                                                            "type" : "GreaterOrEqual",
                                                                                            "operand" : [
                                                                                                {
                                                                                                    "asType" : "{urn:hl7-org:elm-types:r1}Quantity",
                                                                                                    "type" : "As",
                                                                                                    "operand" : {
                                                                                                        "localId" : "228",
                                                                                                        "locator" : "45:23-45:40",
                                                                                                        "path" : "result",
                                                                                                        "scope" : "GlucoseTest",
                                                                                                        "type" : "Property"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "localId" : "229",
                                                                                                    "locator" : "45:45-45:55",
                                                                                                    "value" : 200,
                                                                                                    "unit" : "mg/dL",
                                                                                                    "type" : "Quantity"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "localId" : "239",
                                                                                            "locator" : "46:23-46:132",
                                                                                            "type" : "In",
                                                                                            "operand" : [
                                                                                                {
                                                                                                    "localId" : "236",
                                                                                                    "locator" : "46:23-46:102",
                                                                                                    "name" : "EarliestOf",
                                                                                                    "libraryName" : "Global",
                                                                                                    "type" : "FunctionRef",
                                                                                                    "operand" : [
                                                                                                        {
                                                                                                            "localId" : "233",
                                                                                                            "locator" : "46:45-46:72",
                                                                                                            "path" : "relevantDatetime",
                                                                                                            "scope" : "GlucoseTest",
                                                                                                            "type" : "Property"
                                                                                                        },
                                                                                                        {
                                                                                                            "localId" : "235",
                                                                                                            "locator" : "46:75-46:100",
                                                                                                            "path" : "relevantPeriod",
                                                                                                            "scope" : "GlucoseTest",
                                                                                                            "type" : "Property"
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "localId" : "238",
                                                                                                    "locator" : "46:111-46:132",
                                                                                                    "path" : "dayPeriod",
                                                                                                    "scope" : "EncounterDay",
                                                                                                    "type" : "Property"
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            }
                                                                        }
                                                                    },
                                                                    {
                                                                        "name" : "hasNoGlucoseTest",
                                                                        "value" : {
                                                                            "localId" : "256",
                                                                            "locator" : "48:31-50:13",
                                                                            "type" : "Not",
                                                                            "operand" : {
                                                                                "localId" : "255",
                                                                                "locator" : "48:35-50:13",
                                                                                "type" : "Exists",
                                                                                "operand" : {
                                                                                    "localId" : "254",
                                                                                    "locator" : "48:42-50:13",
                                                                                    "type" : "Query",
                                                                                    "source" : [
                                                                                        {
                                                                                            "localId" : "244",
                                                                                            "locator" : "48:44-48:121",
                                                                                            "alias" : "GlucoseTest",
                                                                                            "expression" : {
                                                                                                "localId" : "243",
                                                                                                "locator" : "48:44-48:109",
                                                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveLaboratoryTestPerformed",
                                                                                                "templateId" : "PositiveLaboratoryTestPerformed",
                                                                                                "codeProperty" : "code",
                                                                                                "codeComparator" : "in",
                                                                                                "type" : "Retrieve",
                                                                                                "codes" : {
                                                                                                    "locator" : "48:75-48:108",
                                                                                                    "name" : "Glucose Lab Test Mass Per Volume",
                                                                                                    "type" : "ValueSetRef"
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    ],
                                                                                    "relationship" : [

                                                                                    ],
                                                                                    "where" : {
                                                                                        "localId" : "253",
                                                                                        "locator" : "49:17-49:132",
                                                                                        "type" : "In",
                                                                                        "operand" : [
                                                                                            {
                                                                                                "localId" : "250",
                                                                                                "locator" : "49:23-49:102",
                                                                                                "name" : "EarliestOf",
                                                                                                "libraryName" : "Global",
                                                                                                "type" : "FunctionRef",
                                                                                                "operand" : [
                                                                                                    {
                                                                                                        "localId" : "247",
                                                                                                        "locator" : "49:45-49:72",
                                                                                                        "path" : "relevantDatetime",
                                                                                                        "scope" : "GlucoseTest",
                                                                                                        "type" : "Property"
                                                                                                    },
                                                                                                    {
                                                                                                        "localId" : "249",
                                                                                                        "locator" : "49:75-49:100",
                                                                                                        "path" : "relevantPeriod",
                                                                                                        "scope" : "GlucoseTest",
                                                                                                        "type" : "Property"
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "localId" : "252",
                                                                                                "locator" : "49:111-49:132",
                                                                                                "path" : "dayPeriod",
                                                                                                "scope" : "EncounterDay",
                                                                                                "type" : "Property"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "311",
                                "locator" : "56:1-74:5",
                                "name" : "Days with Hyperglycemic Events",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "311",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*# days with hyper events uses \"Days With Glucose Results\" to find if hyper event on each day. Skips 1st day in 'RelevantDays`. Returns boolean based on: Today high result OR Today no result AND Yesterday high result AND 2 days ago high result*/",
                                                        "define ",
                                                        "\"Days with Hyperglycemic Events\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "310",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "265",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "264",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Days with Glucose Results\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "EncounterWithResultDays"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "let "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "302",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "eligibleEventDays",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "301",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "267",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "266",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EncounterWithResultDays",
                                                                                                                        ".",
                                                                                                                        "relevantDays"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " ",
                                                                                                        "EncounterDay"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n      "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "271",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "where "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "271",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "269",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "268",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EncounterDay"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "269",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "dayNumber"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "270",
                                                                                                    "value" : [
                                                                                                        " ",
                                                                                                        ">",
                                                                                                        " ",
                                                                                                        "1"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n      "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "300",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "return "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "299",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Tuple {\n        "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "dayNumber",
                                                                                                                ": "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "273",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "272",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterDay"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "273",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "dayNumber"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ",\n        "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "dayPeriod",
                                                                                                                ": "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "275",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "274",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterDay"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "275",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "dayPeriod"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ",\n        "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "hasHyperglycemicEvent",
                                                                                                                ": "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "298",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "( "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "298",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "277",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "276",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "EncounterDay"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "277",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "hasSevereResult"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\n            or "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "297",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "( "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "297",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "r" : "288",
                                                                                                                                            "s" : [
                                                                                                                                                {
                                                                                                                                                    "r" : "279",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "r" : "278",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "EncounterDay"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "."
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "r" : "279",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "hasNoGlucoseTest"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "\n                and "
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "r" : "287",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "r" : "286",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "281",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "280",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "EncounterWithResultDays"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                "."
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "281",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "relevantDays"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "["
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "r" : "285",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "283",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "282",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "EncounterDay"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "."
                                                                                                                                                                                    ]
                                                                                                                                                                                },
                                                                                                                                                                                {
                                                                                                                                                                                    "r" : "283",
                                                                                                                                                                                    "s" : [
                                                                                                                                                                                        {
                                                                                                                                                                                            "value" : [
                                                                                                                                                                                                "dayNumber"
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "284",
                                                                                                                                                                            "value" : [
                                                                                                                                                                                " - ",
                                                                                                                                                                                "2"
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "]"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "."
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "r" : "287",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "hasElevatedResult"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\n                and "
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "r" : "296",
                                                                                                                                            "s" : [
                                                                                                                                                {
                                                                                                                                                    "r" : "295",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "r" : "290",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "289",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                "EncounterWithResultDays"
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "value" : [
                                                                                                                                                                        "."
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "r" : "290",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                "relevantDays"
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "["
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "r" : "294",
                                                                                                                                                            "s" : [
                                                                                                                                                                {
                                                                                                                                                                    "r" : "292",
                                                                                                                                                                    "s" : [
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "291",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "EncounterDay"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "value" : [
                                                                                                                                                                                "."
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "r" : "292",
                                                                                                                                                                            "s" : [
                                                                                                                                                                                {
                                                                                                                                                                                    "value" : [
                                                                                                                                                                                        "dayNumber"
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                },
                                                                                                                                                                {
                                                                                                                                                                    "r" : "293",
                                                                                                                                                                    "value" : [
                                                                                                                                                                        " - ",
                                                                                                                                                                        "3"
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        },
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "]"
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "."
                                                                                                                                                    ]
                                                                                                                                                },
                                                                                                                                                {
                                                                                                                                                    "r" : "296",
                                                                                                                                                    "s" : [
                                                                                                                                                        {
                                                                                                                                                            "value" : [
                                                                                                                                                                "hasElevatedResult"
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "\n            )"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "\n        )"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n      }"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "309",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "308",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "Tuple {\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "304",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "303",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EncounterWithResultDays"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "304",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "encounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "relevantPeriod",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "306",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "305",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EncounterWithResultDays"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "306",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "relevantPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "eligibleEventDays",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "307",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "eligibleEventDays"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n    }"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "310",
                                    "locator" : "57:3-74:5",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "265",
                                            "locator" : "57:3-57:53",
                                            "alias" : "EncounterWithResultDays",
                                            "expression" : {
                                                "localId" : "264",
                                                "locator" : "57:3-57:29",
                                                "name" : "Days with Glucose Results",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "302",
                                            "locator" : "58:9-69:7",
                                            "identifier" : "eligibleEventDays",
                                            "expression" : {
                                                "localId" : "301",
                                                "locator" : "58:28-69:7",
                                                "type" : "Query",
                                                "source" : [
                                                    {
                                                        "localId" : "267",
                                                        "locator" : "58:28-58:76",
                                                        "alias" : "EncounterDay",
                                                        "expression" : {
                                                            "localId" : "266",
                                                            "locator" : "58:28-58:63",
                                                            "path" : "relevantDays",
                                                            "scope" : "EncounterWithResultDays",
                                                            "type" : "Property"
                                                        }
                                                    }
                                                ],
                                                "relationship" : [

                                                ],
                                                "where" : {
                                                    "localId" : "271",
                                                    "locator" : "59:7-59:38",
                                                    "type" : "Greater",
                                                    "operand" : [
                                                        {
                                                            "localId" : "269",
                                                            "locator" : "59:13-59:34",
                                                            "path" : "dayNumber",
                                                            "scope" : "EncounterDay",
                                                            "type" : "Property"
                                                        },
                                                        {
                                                            "localId" : "270",
                                                            "locator" : "59:38",
                                                            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                            "value" : "1",
                                                            "type" : "Literal"
                                                        }
                                                    ]
                                                },
                                                "return" : {
                                                    "localId" : "300",
                                                    "locator" : "60:7-69:7",
                                                    "expression" : {
                                                        "localId" : "299",
                                                        "locator" : "60:14-69:7",
                                                        "type" : "Tuple",
                                                        "element" : [
                                                            {
                                                                "name" : "dayNumber",
                                                                "value" : {
                                                                    "localId" : "273",
                                                                    "locator" : "61:20-61:41",
                                                                    "path" : "dayNumber",
                                                                    "scope" : "EncounterDay",
                                                                    "type" : "Property"
                                                                }
                                                            },
                                                            {
                                                                "name" : "dayPeriod",
                                                                "value" : {
                                                                    "localId" : "275",
                                                                    "locator" : "62:20-62:41",
                                                                    "path" : "dayPeriod",
                                                                    "scope" : "EncounterDay",
                                                                    "type" : "Property"
                                                                }
                                                            },
                                                            {
                                                                "name" : "hasHyperglycemicEvent",
                                                                "value" : {
                                                                    "localId" : "298",
                                                                    "locator" : "63:32-68:9",
                                                                    "type" : "Or",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "277",
                                                                            "locator" : "63:34-63:61",
                                                                            "path" : "hasSevereResult",
                                                                            "scope" : "EncounterDay",
                                                                            "type" : "Property"
                                                                        },
                                                                        {
                                                                            "localId" : "297",
                                                                            "locator" : "64:16-67:13",
                                                                            "type" : "And",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "288",
                                                                                    "locator" : "64:18-65:102",
                                                                                    "type" : "And",
                                                                                    "operand" : [
                                                                                        {
                                                                                            "localId" : "279",
                                                                                            "locator" : "64:18-64:46",
                                                                                            "path" : "hasNoGlucoseTest",
                                                                                            "scope" : "EncounterDay",
                                                                                            "type" : "Property"
                                                                                        },
                                                                                        {
                                                                                            "localId" : "287",
                                                                                            "locator" : "65:21-65:102",
                                                                                            "path" : "hasElevatedResult",
                                                                                            "type" : "Property",
                                                                                            "source" : {
                                                                                                "localId" : "286",
                                                                                                "locator" : "65:21-65:84",
                                                                                                "type" : "Indexer",
                                                                                                "operand" : [
                                                                                                    {
                                                                                                        "localId" : "281",
                                                                                                        "locator" : "65:21-65:56",
                                                                                                        "path" : "relevantDays",
                                                                                                        "scope" : "EncounterWithResultDays",
                                                                                                        "type" : "Property"
                                                                                                    },
                                                                                                    {
                                                                                                        "localId" : "285",
                                                                                                        "locator" : "65:58-65:83",
                                                                                                        "type" : "Subtract",
                                                                                                        "operand" : [
                                                                                                            {
                                                                                                                "localId" : "283",
                                                                                                                "locator" : "65:58-65:79",
                                                                                                                "path" : "dayNumber",
                                                                                                                "scope" : "EncounterDay",
                                                                                                                "type" : "Property"
                                                                                                            },
                                                                                                            {
                                                                                                                "localId" : "284",
                                                                                                                "locator" : "65:83",
                                                                                                                "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                                                                                "value" : "2",
                                                                                                                "type" : "Literal"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "localId" : "296",
                                                                                    "locator" : "66:21-66:102",
                                                                                    "path" : "hasElevatedResult",
                                                                                    "type" : "Property",
                                                                                    "source" : {
                                                                                        "localId" : "295",
                                                                                        "locator" : "66:21-66:84",
                                                                                        "type" : "Indexer",
                                                                                        "operand" : [
                                                                                            {
                                                                                                "localId" : "290",
                                                                                                "locator" : "66:21-66:56",
                                                                                                "path" : "relevantDays",
                                                                                                "scope" : "EncounterWithResultDays",
                                                                                                "type" : "Property"
                                                                                            },
                                                                                            {
                                                                                                "localId" : "294",
                                                                                                "locator" : "66:58-66:83",
                                                                                                "type" : "Subtract",
                                                                                                "operand" : [
                                                                                                    {
                                                                                                        "localId" : "292",
                                                                                                        "locator" : "66:58-66:79",
                                                                                                        "path" : "dayNumber",
                                                                                                        "scope" : "EncounterDay",
                                                                                                        "type" : "Property"
                                                                                                    },
                                                                                                    {
                                                                                                        "localId" : "293",
                                                                                                        "locator" : "66:83",
                                                                                                        "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                                                                        "value" : "3",
                                                                                                        "type" : "Literal"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "309",
                                        "locator" : "70:5-74:5",
                                        "expression" : {
                                            "localId" : "308",
                                            "locator" : "70:12-74:5",
                                            "type" : "Tuple",
                                            "element" : [
                                                {
                                                    "name" : "encounter",
                                                    "value" : {
                                                        "localId" : "304",
                                                        "locator" : "71:18-71:50",
                                                        "path" : "encounter",
                                                        "scope" : "EncounterWithResultDays",
                                                        "type" : "Property"
                                                    }
                                                },
                                                {
                                                    "name" : "relevantPeriod",
                                                    "value" : {
                                                        "localId" : "306",
                                                        "locator" : "72:23-72:60",
                                                        "path" : "relevantPeriod",
                                                        "scope" : "EncounterWithResultDays",
                                                        "type" : "Property"
                                                    }
                                                },
                                                {
                                                    "name" : "eligibleEventDays",
                                                    "value" : {
                                                        "localId" : "307",
                                                        "locator" : "73:26-73:42",
                                                        "name" : "eligibleEventDays",
                                                        "type" : "QueryLetRef"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "348",
                                "locator" : "128:1-136:22",
                                "name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "348",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "347",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "from\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "315",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "314",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Initial Population\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "InpatientHospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "317",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "316",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "316",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Laboratory Test, Performed\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Glucose Lab Test Mass Per Volume\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "GlucoseTest"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "let "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "321",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "HospitalizationInterval",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "320",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "318",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "320",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"HospitalizationWithObservation\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "319",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "InpatientHospitalization"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "328",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "GlucoseTestTime",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "327",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "322",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "327",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"EarliestOf\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "324",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "323",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "GlucoseTest"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "324",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantDatetime"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "326",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "325",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "GlucoseTest"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "326",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "344",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "where "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "344",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "332",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "330",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "329",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "GlucoseTest"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "330",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "result"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        ">=",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "331",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "1000 ",
                                                                                                "'mg/dL'"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n      and "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "343",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "333",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "GlucoseTestTime"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "343",
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "during",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "342",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Interval["
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "337",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "337",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "335",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "334",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "HospitalizationInterval"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " - "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "336",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "1 ",
                                                                                                                        "hour"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "341",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "341",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "339",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "338",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "HospitalizationInterval"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " + "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "340",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "6 ",
                                                                                                                        "hours"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "346",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "345",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "GlucoseTest"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "347",
                                    "locator" : "129:3-136:22",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "315",
                                            "locator" : "130:5-130:49",
                                            "alias" : "InpatientHospitalization",
                                            "expression" : {
                                                "localId" : "314",
                                                "locator" : "130:5-130:24",
                                                "name" : "Initial Population",
                                                "type" : "ExpressionRef"
                                            }
                                        },
                                        {
                                            "localId" : "317",
                                            "locator" : "131:5-131:82",
                                            "alias" : "GlucoseTest",
                                            "expression" : {
                                                "localId" : "316",
                                                "locator" : "131:5-131:70",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveLaboratoryTestPerformed",
                                                "templateId" : "PositiveLaboratoryTestPerformed",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "131:36-131:69",
                                                    "name" : "Glucose Lab Test Mass Per Volume",
                                                    "type" : "ValueSetRef"
                                                }
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "321",
                                            "locator" : "132:9-132:101",
                                            "identifier" : "HospitalizationInterval",
                                            "expression" : {
                                                "localId" : "320",
                                                "locator" : "132:34-132:101",
                                                "name" : "HospitalizationWithObservation",
                                                "libraryName" : "Global",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "319",
                                                        "locator" : "132:76-132:99",
                                                        "name" : "InpatientHospitalization",
                                                        "type" : "AliasRef"
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "328",
                                            "locator" : "133:5-133:101",
                                            "identifier" : "GlucoseTestTime",
                                            "expression" : {
                                                "localId" : "327",
                                                "locator" : "133:22-133:101",
                                                "name" : "EarliestOf",
                                                "libraryName" : "Global",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "324",
                                                        "locator" : "133:44-133:71",
                                                        "path" : "relevantDatetime",
                                                        "scope" : "GlucoseTest",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "326",
                                                        "locator" : "133:74-133:99",
                                                        "path" : "relevantPeriod",
                                                        "scope" : "GlucoseTest",
                                                        "type" : "Property"
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "where" : {
                                        "localId" : "344",
                                        "locator" : "134:5-135:136",
                                        "type" : "And",
                                        "operand" : [
                                            {
                                                "localId" : "332",
                                                "locator" : "134:11-134:44",
                                                "type" : "GreaterOrEqual",
                                                "operand" : [
                                                    {
                                                        "asType" : "{urn:hl7-org:elm-types:r1}Quantity",
                                                        "type" : "As",
                                                        "operand" : {
                                                            "localId" : "330",
                                                            "locator" : "134:11-134:28",
                                                            "path" : "result",
                                                            "scope" : "GlucoseTest",
                                                            "type" : "Property"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "331",
                                                        "locator" : "134:33-134:44",
                                                        "value" : 1000,
                                                        "unit" : "mg/dL",
                                                        "type" : "Quantity"
                                                    }
                                                ]
                                            },
                                            {
                                                "localId" : "343",
                                                "locator" : "135:11-135:136",
                                                "type" : "In",
                                                "operand" : [
                                                    {
                                                        "localId" : "333",
                                                        "locator" : "135:11-135:25",
                                                        "name" : "GlucoseTestTime",
                                                        "type" : "QueryLetRef"
                                                    },
                                                    {
                                                        "localId" : "342",
                                                        "locator" : "135:34-135:136",
                                                        "lowClosed" : true,
                                                        "highClosed" : true,
                                                        "type" : "Interval",
                                                        "low" : {
                                                            "localId" : "337",
                                                            "locator" : "135:43-135:87",
                                                            "type" : "Subtract",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "335",
                                                                    "locator" : "135:45-135:76",
                                                                    "type" : "Start",
                                                                    "operand" : {
                                                                        "localId" : "334",
                                                                        "locator" : "135:54-135:76",
                                                                        "name" : "HospitalizationInterval",
                                                                        "type" : "QueryLetRef"
                                                                    }
                                                                },
                                                                {
                                                                    "localId" : "336",
                                                                    "locator" : "135:80-135:85",
                                                                    "value" : 1,
                                                                    "unit" : "hour",
                                                                    "type" : "Quantity"
                                                                }
                                                            ]
                                                        },
                                                        "high" : {
                                                            "localId" : "341",
                                                            "locator" : "135:90-135:135",
                                                            "type" : "Add",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "339",
                                                                    "locator" : "135:92-135:123",
                                                                    "type" : "Start",
                                                                    "operand" : {
                                                                        "localId" : "338",
                                                                        "locator" : "135:101-135:123",
                                                                        "name" : "HospitalizationInterval",
                                                                        "type" : "QueryLetRef"
                                                                    }
                                                                },
                                                                {
                                                                    "localId" : "340",
                                                                    "locator" : "135:127-135:133",
                                                                    "value" : 6,
                                                                    "unit" : "hours",
                                                                    "type" : "Quantity"
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    "return" : {
                                        "localId" : "346",
                                        "locator" : "136:5-136:22",
                                        "expression" : {
                                            "localId" : "345",
                                            "locator" : "136:12-136:22",
                                            "name" : "GlucoseTest",
                                            "type" : "AliasRef"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "406",
                                "locator" : "138:1-149:28",
                                "name" : "Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "406",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "405",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "from\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "354",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "353",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Initial Population\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "InpatientHospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "356",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "355",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "GlucoseResult1000"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "358",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "357",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "357",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Laboratory Test, Performed\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Glucose Lab Test Mass Per Volume\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "EarlierGlucoseTest"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "let "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "362",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "HospitalizationInterval",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "361",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "359",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "361",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"HospitalizationWithObservation\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "360",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "InpatientHospitalization"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "369",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "GlucoseTest1000Time",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "368",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "363",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "368",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"EarliestOf\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "365",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "364",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "GlucoseResult1000"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "365",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantDatetime"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "367",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "366",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "GlucoseResult1000"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "367",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ",\n    "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "376",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "EarlierGlucoseTestTime",
                                                                                ": "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "375",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "370",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Global"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "375",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"EarliestOf\"",
                                                                                                " ( "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "372",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "371",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "EarlierGlucoseTest"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "372",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantDatetime"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "374",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "373",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "EarlierGlucoseTest"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "374",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " )"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "402",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "where "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "402",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "396",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "387",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "377",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "GlucoseTest1000Time"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "387",
                                                                                            "value" : [
                                                                                                " ",
                                                                                                "during",
                                                                                                " "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "386",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Interval["
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "381",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "( "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "381",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "379",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "378",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "HospitalizationInterval"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " - "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "380",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "1 ",
                                                                                                                                "hour"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " )"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ", "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "385",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "( "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "385",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "383",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "382",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "HospitalizationInterval"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " + "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "384",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "6 ",
                                                                                                                                "hour"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " )"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "]"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n      and "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "395",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "388",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EarlierGlucoseTestTime"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "395",
                                                                                            "value" : [
                                                                                                " ",
                                                                                                "during",
                                                                                                " "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "394",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Interval["
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "392",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "( "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "392",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "390",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "389",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "HospitalizationInterval"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " - "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "391",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "1 ",
                                                                                                                                "hour"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " )"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ", "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "393",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "GlucoseTest1000Time"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n      and "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "401",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "398",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "397",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EarlierGlucoseTest"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "398",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "id"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "!~",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "400",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "399",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "GlucoseResult1000"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "400",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "id"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "404",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "403",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "GlucoseResult1000"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "405",
                                    "locator" : "139:3-149:28",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "354",
                                            "locator" : "140:5-140:49",
                                            "alias" : "InpatientHospitalization",
                                            "expression" : {
                                                "localId" : "353",
                                                "locator" : "140:5-140:24",
                                                "name" : "Initial Population",
                                                "type" : "ExpressionRef"
                                            }
                                        },
                                        {
                                            "localId" : "356",
                                            "locator" : "141:5-141:118",
                                            "alias" : "GlucoseResult1000",
                                            "expression" : {
                                                "localId" : "355",
                                                "locator" : "141:5-141:100",
                                                "name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                                "type" : "ExpressionRef"
                                            }
                                        },
                                        {
                                            "localId" : "358",
                                            "locator" : "142:5-142:89",
                                            "alias" : "EarlierGlucoseTest",
                                            "expression" : {
                                                "localId" : "357",
                                                "locator" : "142:5-142:70",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveLaboratoryTestPerformed",
                                                "templateId" : "PositiveLaboratoryTestPerformed",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "142:36-142:69",
                                                    "name" : "Glucose Lab Test Mass Per Volume",
                                                    "type" : "ValueSetRef"
                                                }
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "362",
                                            "locator" : "143:9-143:101",
                                            "identifier" : "HospitalizationInterval",
                                            "expression" : {
                                                "localId" : "361",
                                                "locator" : "143:34-143:101",
                                                "name" : "HospitalizationWithObservation",
                                                "libraryName" : "Global",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "360",
                                                        "locator" : "143:76-143:99",
                                                        "name" : "InpatientHospitalization",
                                                        "type" : "AliasRef"
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "369",
                                            "locator" : "144:5-144:117",
                                            "identifier" : "GlucoseTest1000Time",
                                            "expression" : {
                                                "localId" : "368",
                                                "locator" : "144:26-144:117",
                                                "name" : "EarliestOf",
                                                "libraryName" : "Global",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "365",
                                                        "locator" : "144:48-144:81",
                                                        "path" : "relevantDatetime",
                                                        "scope" : "GlucoseResult1000",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "367",
                                                        "locator" : "144:84-144:115",
                                                        "path" : "relevantPeriod",
                                                        "scope" : "GlucoseResult1000",
                                                        "type" : "Property"
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "376",
                                            "locator" : "145:5-145:122",
                                            "identifier" : "EarlierGlucoseTestTime",
                                            "expression" : {
                                                "localId" : "375",
                                                "locator" : "145:29-145:122",
                                                "name" : "EarliestOf",
                                                "libraryName" : "Global",
                                                "type" : "FunctionRef",
                                                "operand" : [
                                                    {
                                                        "localId" : "372",
                                                        "locator" : "145:51-145:85",
                                                        "path" : "relevantDatetime",
                                                        "scope" : "EarlierGlucoseTest",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "374",
                                                        "locator" : "145:88-145:120",
                                                        "path" : "relevantPeriod",
                                                        "scope" : "EarlierGlucoseTest",
                                                        "type" : "Property"
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "where" : {
                                        "localId" : "402",
                                        "locator" : "146:5-148:55",
                                        "type" : "And",
                                        "operand" : [
                                            {
                                                "localId" : "396",
                                                "locator" : "146:11-147:117",
                                                "type" : "And",
                                                "operand" : [
                                                    {
                                                        "localId" : "387",
                                                        "locator" : "146:11-146:139",
                                                        "type" : "In",
                                                        "operand" : [
                                                            {
                                                                "localId" : "377",
                                                                "locator" : "146:11-146:29",
                                                                "name" : "GlucoseTest1000Time",
                                                                "type" : "QueryLetRef"
                                                            },
                                                            {
                                                                "localId" : "386",
                                                                "locator" : "146:38-146:139",
                                                                "lowClosed" : true,
                                                                "highClosed" : true,
                                                                "type" : "Interval",
                                                                "low" : {
                                                                    "localId" : "381",
                                                                    "locator" : "146:47-146:91",
                                                                    "type" : "Subtract",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "379",
                                                                            "locator" : "146:49-146:80",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "378",
                                                                                "locator" : "146:58-146:80",
                                                                                "name" : "HospitalizationInterval",
                                                                                "type" : "QueryLetRef"
                                                                            }
                                                                        },
                                                                        {
                                                                            "localId" : "380",
                                                                            "locator" : "146:84-146:89",
                                                                            "value" : 1,
                                                                            "unit" : "hour",
                                                                            "type" : "Quantity"
                                                                        }
                                                                    ]
                                                                },
                                                                "high" : {
                                                                    "localId" : "385",
                                                                    "locator" : "146:94-146:138",
                                                                    "type" : "Add",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "383",
                                                                            "locator" : "146:96-146:127",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "382",
                                                                                "locator" : "146:105-146:127",
                                                                                "name" : "HospitalizationInterval",
                                                                                "type" : "QueryLetRef"
                                                                            }
                                                                        },
                                                                        {
                                                                            "localId" : "384",
                                                                            "locator" : "146:131-146:136",
                                                                            "value" : 6,
                                                                            "unit" : "hour",
                                                                            "type" : "Quantity"
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "localId" : "395",
                                                        "locator" : "147:11-147:117",
                                                        "type" : "In",
                                                        "operand" : [
                                                            {
                                                                "localId" : "388",
                                                                "locator" : "147:11-147:32",
                                                                "name" : "EarlierGlucoseTestTime",
                                                                "type" : "QueryLetRef"
                                                            },
                                                            {
                                                                "localId" : "394",
                                                                "locator" : "147:41-147:117",
                                                                "lowClosed" : true,
                                                                "highClosed" : false,
                                                                "type" : "Interval",
                                                                "low" : {
                                                                    "localId" : "392",
                                                                    "locator" : "147:50-147:94",
                                                                    "type" : "Subtract",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "390",
                                                                            "locator" : "147:52-147:83",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "389",
                                                                                "locator" : "147:61-147:83",
                                                                                "name" : "HospitalizationInterval",
                                                                                "type" : "QueryLetRef"
                                                                            }
                                                                        },
                                                                        {
                                                                            "localId" : "391",
                                                                            "locator" : "147:87-147:92",
                                                                            "value" : 1,
                                                                            "unit" : "hour",
                                                                            "type" : "Quantity"
                                                                        }
                                                                    ]
                                                                },
                                                                "high" : {
                                                                    "localId" : "393",
                                                                    "locator" : "147:97-147:115",
                                                                    "name" : "GlucoseTest1000Time",
                                                                    "type" : "QueryLetRef"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "localId" : "401",
                                                "locator" : "148:11-148:55",
                                                "type" : "Not",
                                                "operand" : {
                                                    "locator" : "148:11-148:55",
                                                    "type" : "Equivalent",
                                                    "operand" : [
                                                        {
                                                            "localId" : "398",
                                                            "locator" : "148:11-148:31",
                                                            "path" : "id",
                                                            "scope" : "EarlierGlucoseTest",
                                                            "type" : "Property"
                                                        },
                                                        {
                                                            "localId" : "400",
                                                            "locator" : "148:36-148:55",
                                                            "path" : "id",
                                                            "scope" : "GlucoseResult1000",
                                                            "type" : "Property"
                                                        }
                                                    ]
                                                }
                                            }
                                        ]
                                    },
                                    "return" : {
                                        "localId" : "404",
                                        "locator" : "149:5-149:28",
                                        "expression" : {
                                            "localId" : "403",
                                            "locator" : "149:12-149:28",
                                            "name" : "GlucoseResult1000",
                                            "type" : "AliasRef"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "412",
                                "locator" : "151:1-153:168",
                                "name" : "Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "412",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "411",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "350",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "349",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "GlucoseResult1000"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "410",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "where "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "410",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "not "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "409",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "( "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "409",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "352",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "351",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "GlucoseResult1000"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "352",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "id"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " in "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "408",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "407",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "\"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "408",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "id"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "411",
                                    "locator" : "152:3-153:168",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "350",
                                            "locator" : "152:3-152:116",
                                            "alias" : "GlucoseResult1000",
                                            "expression" : {
                                                "localId" : "349",
                                                "locator" : "152:3-152:98",
                                                "name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "where" : {
                                        "localId" : "410",
                                        "locator" : "153:5-153:168",
                                        "type" : "Not",
                                        "operand" : {
                                            "localId" : "409",
                                            "locator" : "153:15-153:168",
                                            "type" : "In",
                                            "operand" : [
                                                {
                                                    "localId" : "352",
                                                    "locator" : "153:17-153:36",
                                                    "path" : "id",
                                                    "scope" : "GlucoseResult1000",
                                                    "type" : "Property"
                                                },
                                                {
                                                    "localId" : "408",
                                                    "locator" : "153:41-153:166",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "alias" : "$this",
                                                            "expression" : {
                                                                "localId" : "407",
                                                                "locator" : "153:41-153:163",
                                                                "name" : "Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                                                "type" : "ExpressionRef"
                                                            }
                                                        }
                                                    ],
                                                    "where" : {
                                                        "type" : "Not",
                                                        "operand" : {
                                                            "type" : "IsNull",
                                                            "operand" : {
                                                                "path" : "id",
                                                                "type" : "Property",
                                                                "source" : {
                                                                    "name" : "$this",
                                                                    "type" : "AliasRef"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "return" : {
                                                        "distinct" : false,
                                                        "expression" : {
                                                            "path" : "id",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "name" : "$this",
                                                                "type" : "AliasRef"
                                                            }
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "444",
                                "locator" : "99:1-104:35",
                                "name" : "Encounter with First Glucose Greater Than or Equal to 1000",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "444",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Encounter with First Glucose Greater Than or Equal to 1000\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "443",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "313",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "312",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Initial Population\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "InpatientHospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "440",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "with "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "414",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "413",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "FirstGlucoseResult"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n      such that "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "439",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "418",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "416",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "415",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "FirstGlucoseResult"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "416",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "result"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        ">=",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "417",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "1000 ",
                                                                                                "'mg/dL'"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n        and "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "438",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "424",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "419",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Global"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "424",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"EarliestOf\"",
                                                                                                        " ( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "421",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "420",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "FirstGlucoseResult"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "421",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantDatetime"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ", "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "423",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "422",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "FirstGlucoseResult"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "423",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "438",
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "during",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "437",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Interval["
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "430",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "430",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "428",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "427",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "425",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "Global"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "427",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "\"HospitalizationWithObservation\"",
                                                                                                                                        " ( "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "426",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "InpatientHospitalization"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        " )"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " - "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "429",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "1 ",
                                                                                                                        "hour"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "436",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "( "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "436",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "434",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "433",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "431",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "Global"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "433",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "\"HospitalizationWithObservation\"",
                                                                                                                                        " ( "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "432",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "InpatientHospitalization"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        " )"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " + "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "435",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "6 ",
                                                                                                                        "hours"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " )"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "442",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "441",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "InpatientHospitalization"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "443",
                                    "locator" : "100:3-104:35",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "313",
                                            "locator" : "100:3-100:47",
                                            "alias" : "InpatientHospitalization",
                                            "expression" : {
                                                "localId" : "312",
                                                "locator" : "100:3-100:22",
                                                "name" : "Initial Population",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [
                                        {
                                            "localId" : "440",
                                            "locator" : "101:5-103:307",
                                            "alias" : "FirstGlucoseResult",
                                            "type" : "With",
                                            "expression" : {
                                                "localId" : "413",
                                                "locator" : "101:10-101:113",
                                                "name" : "Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                                                "type" : "ExpressionRef"
                                            },
                                            "suchThat" : {
                                                "localId" : "439",
                                                "locator" : "102:17-103:307",
                                                "type" : "And",
                                                "operand" : [
                                                    {
                                                        "localId" : "418",
                                                        "locator" : "102:17-102:57",
                                                        "type" : "GreaterOrEqual",
                                                        "operand" : [
                                                            {
                                                                "asType" : "{urn:hl7-org:elm-types:r1}Quantity",
                                                                "type" : "As",
                                                                "operand" : {
                                                                    "localId" : "416",
                                                                    "locator" : "102:17-102:41",
                                                                    "path" : "result",
                                                                    "scope" : "FirstGlucoseResult",
                                                                    "type" : "Property"
                                                                }
                                                            },
                                                            {
                                                                "localId" : "417",
                                                                "locator" : "102:46-102:57",
                                                                "value" : 1000,
                                                                "unit" : "mg/dL",
                                                                "type" : "Quantity"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "localId" : "438",
                                                        "locator" : "103:13-103:307",
                                                        "type" : "In",
                                                        "operand" : [
                                                            {
                                                                "localId" : "424",
                                                                "locator" : "103:13-103:106",
                                                                "name" : "EarliestOf",
                                                                "libraryName" : "Global",
                                                                "type" : "FunctionRef",
                                                                "operand" : [
                                                                    {
                                                                        "localId" : "421",
                                                                        "locator" : "103:35-103:69",
                                                                        "path" : "relevantDatetime",
                                                                        "scope" : "FirstGlucoseResult",
                                                                        "type" : "Property"
                                                                    },
                                                                    {
                                                                        "localId" : "423",
                                                                        "locator" : "103:72-103:104",
                                                                        "path" : "relevantPeriod",
                                                                        "scope" : "FirstGlucoseResult",
                                                                        "type" : "Property"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "localId" : "437",
                                                                "locator" : "103:115-103:307",
                                                                "lowClosed" : true,
                                                                "highClosed" : true,
                                                                "type" : "Interval",
                                                                "low" : {
                                                                    "localId" : "430",
                                                                    "locator" : "103:124-103:213",
                                                                    "type" : "Subtract",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "428",
                                                                            "locator" : "103:126-103:202",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "427",
                                                                                "locator" : "103:135-103:202",
                                                                                "name" : "HospitalizationWithObservation",
                                                                                "libraryName" : "Global",
                                                                                "type" : "FunctionRef",
                                                                                "operand" : [
                                                                                    {
                                                                                        "localId" : "426",
                                                                                        "locator" : "103:177-103:200",
                                                                                        "name" : "InpatientHospitalization",
                                                                                        "type" : "AliasRef"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        },
                                                                        {
                                                                            "localId" : "429",
                                                                            "locator" : "103:206-103:211",
                                                                            "value" : 1,
                                                                            "unit" : "hour",
                                                                            "type" : "Quantity"
                                                                        }
                                                                    ]
                                                                },
                                                                "high" : {
                                                                    "localId" : "436",
                                                                    "locator" : "103:216-103:306",
                                                                    "type" : "Add",
                                                                    "operand" : [
                                                                        {
                                                                            "localId" : "434",
                                                                            "locator" : "103:218-103:294",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "433",
                                                                                "locator" : "103:227-103:294",
                                                                                "name" : "HospitalizationWithObservation",
                                                                                "libraryName" : "Global",
                                                                                "type" : "FunctionRef",
                                                                                "operand" : [
                                                                                    {
                                                                                        "localId" : "432",
                                                                                        "locator" : "103:269-103:292",
                                                                                        "name" : "InpatientHospitalization",
                                                                                        "type" : "AliasRef"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        },
                                                                        {
                                                                            "localId" : "435",
                                                                            "locator" : "103:298-103:304",
                                                                            "value" : 6,
                                                                            "unit" : "hours",
                                                                            "type" : "Quantity"
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "return" : {
                                        "localId" : "442",
                                        "locator" : "104:5-104:35",
                                        "expression" : {
                                            "localId" : "441",
                                            "locator" : "104:12-104:35",
                                            "name" : "InpatientHospitalization",
                                            "type" : "AliasRef"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "446",
                                "locator" : "79:1-80:62",
                                "name" : "Denominator Exclusions",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "446",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Denominator Exclusions\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "445",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter with First Glucose Greater Than or Equal to 1000\""
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "445",
                                    "locator" : "80:3-80:62",
                                    "name" : "Encounter with First Glucose Greater Than or Equal to 1000",
                                    "type" : "ExpressionRef"
                                }
                            },
                            {
                                "localId" : "459",
                                "locator" : "115:1-120:43",
                                "name" : "Encounter with Hyperglycemic Events",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "459",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Encounter with Hyperglycemic Events\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "458",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "448",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "447",
                                                                            "s" : [
                                                                                {
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Days with Hyperglycemic Events\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "HyperglycemicEventDays"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "454",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "where "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "454",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "exists "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "453",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "( "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "453",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "450",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "449",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "HyperglycemicEventDays",
                                                                                                                                ".",
                                                                                                                                "eligibleEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "EligibleEventDay"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n        "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "452",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "where "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "452",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "451",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EligibleEventDay"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "452",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "hasHyperglycemicEvent"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n    )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "457",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "return "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "456",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "455",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "HyperglycemicEventDays"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "456",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "458",
                                    "locator" : "116:3-120:43",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "448",
                                            "locator" : "116:3-116:57",
                                            "alias" : "HyperglycemicEventDays",
                                            "expression" : {
                                                "localId" : "447",
                                                "locator" : "116:3-116:34",
                                                "name" : "Days with Hyperglycemic Events",
                                                "type" : "ExpressionRef"
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "where" : {
                                        "localId" : "454",
                                        "locator" : "117:5-119:5",
                                        "type" : "Exists",
                                        "operand" : {
                                            "localId" : "453",
                                            "locator" : "117:18-119:5",
                                            "type" : "Query",
                                            "source" : [
                                                {
                                                    "localId" : "450",
                                                    "locator" : "117:20-117:76",
                                                    "alias" : "EligibleEventDay",
                                                    "expression" : {
                                                        "localId" : "449",
                                                        "locator" : "117:20-117:59",
                                                        "path" : "eligibleEventDays",
                                                        "scope" : "HyperglycemicEventDays",
                                                        "type" : "Property"
                                                    }
                                                }
                                            ],
                                            "relationship" : [

                                            ],
                                            "where" : {
                                                "localId" : "452",
                                                "locator" : "118:9-118:52",
                                                "path" : "hasHyperglycemicEvent",
                                                "scope" : "EligibleEventDay",
                                                "type" : "Property"
                                            }
                                        }
                                    },
                                    "return" : {
                                        "localId" : "457",
                                        "locator" : "120:5-120:43",
                                        "expression" : {
                                            "localId" : "456",
                                            "locator" : "120:12-120:43",
                                            "path" : "encounter",
                                            "scope" : "HyperglycemicEventDays",
                                            "type" : "Property"
                                        }
                                    }
                                }
                            },
                            {
                                "localId" : "461",
                                "locator" : "163:1-164:39",
                                "name" : "Numerator",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "461",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Numerator\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "460",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter with Hyperglycemic Events\""
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "460",
                                    "locator" : "164:3-164:39",
                                    "name" : "Encounter with Hyperglycemic Events",
                                    "type" : "ExpressionRef"
                                }
                            },
                            {
                                "localId" : "463",
                                "locator" : "171:1-172:51",
                                "name" : "SDE Ethnicity",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "463",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"SDE Ethnicity\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "462",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "[",
                                                                "\"Patient Characteristic Ethnicity\"",
                                                                ": "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"Ethnicity\""
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "]"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "462",
                                    "locator" : "172:3-172:51",
                                    "dataType" : "{urn:healthit-gov:qdm:v5_6}PatientCharacteristicEthnicity",
                                    "codeProperty" : "code",
                                    "codeComparator" : "in",
                                    "type" : "Retrieve",
                                    "codes" : {
                                        "locator" : "172:40-172:50",
                                        "name" : "Ethnicity",
                                        "type" : "ValueSetRef"
                                    }
                                }
                            },
                            {
                                "localId" : "465",
                                "locator" : "174:1-175:43",
                                "name" : "SDE Payer",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "465",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"SDE Payer\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "464",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "[",
                                                                "\"Patient Characteristic Payer\"",
                                                                ": "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"Payer\""
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "]"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "464",
                                    "locator" : "175:3-175:43",
                                    "dataType" : "{urn:healthit-gov:qdm:v5_6}PatientCharacteristicPayer",
                                    "codeProperty" : "code",
                                    "codeComparator" : "in",
                                    "type" : "Retrieve",
                                    "codes" : {
                                        "locator" : "175:36-175:42",
                                        "name" : "Payer",
                                        "type" : "ValueSetRef"
                                    }
                                }
                            },
                            {
                                "localId" : "467",
                                "locator" : "177:1-178:41",
                                "name" : "SDE Race",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "467",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"SDE Race\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "466",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "[",
                                                                "\"Patient Characteristic Race\"",
                                                                ": "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"Race\""
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "]"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "466",
                                    "locator" : "178:3-178:41",
                                    "dataType" : "{urn:healthit-gov:qdm:v5_6}PatientCharacteristicRace",
                                    "codeProperty" : "code",
                                    "codeComparator" : "in",
                                    "type" : "Retrieve",
                                    "codes" : {
                                        "locator" : "178:35-178:40",
                                        "name" : "Race",
                                        "type" : "ValueSetRef"
                                    }
                                }
                            },
                            {
                                "localId" : "469",
                                "locator" : "180:1-181:58",
                                "name" : "SDE Sex",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "469",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"SDE Sex\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "468",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "[",
                                                                "\"Patient Characteristic Sex\"",
                                                                ": "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"ONC Administrative Sex\""
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "]"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "468",
                                    "locator" : "181:3-181:58",
                                    "dataType" : "{urn:healthit-gov:qdm:v5_6}PatientCharacteristicSex",
                                    "codeProperty" : "code",
                                    "codeComparator" : "in",
                                    "type" : "Retrieve",
                                    "codes" : {
                                        "locator" : "181:34-181:57",
                                        "name" : "ONC Administrative Sex",
                                        "type" : "ValueSetRef"
                                    }
                                }
                            },
                            {
                                "localId" : "508",
                                "locator" : "215:1-223:3",
                                "name" : "Denominator Observations",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "508",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/**\n * Counts the number of eligible days in an encounter. This simply filters and counts the data built in\n * \"Days With Glucose Results\".*/",
                                                        "define function ",
                                                        "\"Denominator Observations\"",
                                                        "(",
                                                        "QualifyingEncounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "479",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "507",
                                                    "s" : [
                                                        {
                                                            "r" : "507",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "if "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "484",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "481",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "480",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "QualifyingEncounter"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "481",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "id"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " in "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "483",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "482",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Denominator Exclusions\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "483",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "id"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " then "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "494",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "singleton from "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "493",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "( "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "493",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "486",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "485",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"Days with Hyperglycemic Events\""
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "EncounterWithEventDays"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "490",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "where "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "490",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "488",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "487",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterWithEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "488",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "encounter"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "=",
                                                                                                                " "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "489",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "QualifyingEncounter"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "492",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "491",
                                                                                                    "value" : [
                                                                                                        "return ",
                                                                                                        "0"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " \n    else "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "506",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "singleton from "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "505",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "( "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "505",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "496",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "495",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"Days with Hyperglycemic Events\""
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "EncounterWithEventDays"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "500",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "where "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "500",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "498",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "497",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterWithEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "498",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "encounter"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "=",
                                                                                                                " "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "499",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "QualifyingEncounter"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "504",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "return "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "503",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Count",
                                                                                                                "("
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "502",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "501",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterWithEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "502",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "eligibleEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                ")"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "507",
                                    "locator" : "216:3-223:3",
                                    "type" : "If",
                                    "condition" : {
                                        "localId" : "484",
                                        "locator" : "216:6-216:58",
                                        "type" : "In",
                                        "operand" : [
                                            {
                                                "localId" : "481",
                                                "locator" : "216:6-216:27",
                                                "path" : "id",
                                                "type" : "Property",
                                                "source" : {
                                                    "localId" : "480",
                                                    "locator" : "216:6-216:24",
                                                    "name" : "QualifyingEncounter",
                                                    "type" : "OperandRef"
                                                }
                                            },
                                            {
                                                "localId" : "483",
                                                "locator" : "216:32-216:58",
                                                "type" : "Query",
                                                "source" : [
                                                    {
                                                        "alias" : "$this",
                                                        "expression" : {
                                                            "localId" : "482",
                                                            "locator" : "216:32-216:55",
                                                            "name" : "Denominator Exclusions",
                                                            "type" : "ExpressionRef"
                                                        }
                                                    }
                                                ],
                                                "where" : {
                                                    "type" : "Not",
                                                    "operand" : {
                                                        "type" : "IsNull",
                                                        "operand" : {
                                                            "path" : "id",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "name" : "$this",
                                                                "type" : "AliasRef"
                                                            }
                                                        }
                                                    }
                                                },
                                                "return" : {
                                                    "distinct" : false,
                                                    "expression" : {
                                                        "path" : "id",
                                                        "type" : "Property",
                                                        "source" : {
                                                            "name" : "$this",
                                                            "type" : "AliasRef"
                                                        }
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    "then" : {
                                        "localId" : "494",
                                        "locator" : "216:65-219:3",
                                        "type" : "SingletonFrom",
                                        "operand" : {
                                            "localId" : "493",
                                            "locator" : "216:80-219:3",
                                            "type" : "Query",
                                            "source" : [
                                                {
                                                    "localId" : "486",
                                                    "locator" : "216:82-216:136",
                                                    "alias" : "EncounterWithEventDays",
                                                    "expression" : {
                                                        "localId" : "485",
                                                        "locator" : "216:82-216:113",
                                                        "name" : "Days with Hyperglycemic Events",
                                                        "type" : "ExpressionRef"
                                                    }
                                                }
                                            ],
                                            "relationship" : [

                                            ],
                                            "where" : {
                                                "localId" : "490",
                                                "locator" : "217:7-217:66",
                                                "type" : "Equal",
                                                "operand" : [
                                                    {
                                                        "localId" : "488",
                                                        "locator" : "217:13-217:44",
                                                        "path" : "encounter",
                                                        "scope" : "EncounterWithEventDays",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "489",
                                                        "locator" : "217:48-217:66",
                                                        "name" : "QualifyingEncounter",
                                                        "type" : "OperandRef"
                                                    }
                                                ]
                                            },
                                            "return" : {
                                                "localId" : "492",
                                                "locator" : "218:7-218:14",
                                                "expression" : {
                                                    "localId" : "491",
                                                    "locator" : "218:14",
                                                    "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                    "value" : "0",
                                                    "type" : "Literal"
                                                }
                                            }
                                        }
                                    },
                                    "else" : {
                                        "localId" : "506",
                                        "locator" : "220:10-223:3",
                                        "type" : "SingletonFrom",
                                        "operand" : {
                                            "localId" : "505",
                                            "locator" : "220:25-223:3",
                                            "type" : "Query",
                                            "source" : [
                                                {
                                                    "localId" : "496",
                                                    "locator" : "220:27-220:81",
                                                    "alias" : "EncounterWithEventDays",
                                                    "expression" : {
                                                        "localId" : "495",
                                                        "locator" : "220:27-220:58",
                                                        "name" : "Days with Hyperglycemic Events",
                                                        "type" : "ExpressionRef"
                                                    }
                                                }
                                            ],
                                            "relationship" : [

                                            ],
                                            "where" : {
                                                "localId" : "500",
                                                "locator" : "221:7-221:66",
                                                "type" : "Equal",
                                                "operand" : [
                                                    {
                                                        "localId" : "498",
                                                        "locator" : "221:13-221:44",
                                                        "path" : "encounter",
                                                        "scope" : "EncounterWithEventDays",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "499",
                                                        "locator" : "221:48-221:66",
                                                        "name" : "QualifyingEncounter",
                                                        "type" : "OperandRef"
                                                    }
                                                ]
                                            },
                                            "return" : {
                                                "localId" : "504",
                                                "locator" : "222:7-222:60",
                                                "expression" : {
                                                    "localId" : "503",
                                                    "locator" : "222:14-222:60",
                                                    "type" : "Count",
                                                    "source" : {
                                                        "localId" : "502",
                                                        "locator" : "222:20-222:59",
                                                        "path" : "eligibleEventDays",
                                                        "scope" : "EncounterWithEventDays",
                                                        "type" : "Property"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "QualifyingEncounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "479",
                                            "locator" : "215:64-215:85",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "541",
                                "locator" : "228:1-238:3",
                                "name" : "Numerator Observations",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "541",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/**\n * Counts the number of eligible days with a hyperglycemic event in an encounter. This simply filters and counts the data built in\n * \"Days With Hyperglycemic Events\".*/",
                                                        "define function ",
                                                        "\"Numerator Observations\"",
                                                        "(",
                                                        "QualifyingEncounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "509",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "540",
                                                    "s" : [
                                                        {
                                                            "r" : "540",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "if "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "514",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "511",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "510",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "QualifyingEncounter"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "511",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "id"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " in "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "513",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "512",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Denominator Exclusions\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "."
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "513",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "id"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " then "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "524",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "singleton from "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "523",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "( "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "523",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "516",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "515",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"Days with Hyperglycemic Events\""
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "EncounterWithEventDays"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "520",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "where "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "520",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "518",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "517",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterWithEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "518",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "encounter"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "=",
                                                                                                                " "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "519",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "QualifyingEncounter"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "522",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "521",
                                                                                                    "value" : [
                                                                                                        "return ",
                                                                                                        "0"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " \n    else "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "539",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "singleton from "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "538",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "( "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "538",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "526",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "525",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"Days with Hyperglycemic Events\""
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "EncounterWithEventDays"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "530",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "where "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "530",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "528",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "527",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "EncounterWithEventDays"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "528",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "encounter"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " ",
                                                                                                                "=",
                                                                                                                " "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "529",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "QualifyingEncounter"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n      "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "537",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "return "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "536",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Count",
                                                                                                                "("
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "535",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "532",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "531",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "s" : [
                                                                                                                                                {
                                                                                                                                                    "value" : [
                                                                                                                                                        "EncounterWithEventDays",
                                                                                                                                                        ".",
                                                                                                                                                        "eligibleEventDays"
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        " ",
                                                                                                                                        "EligibleEventDay"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "\n          "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "534",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "where "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "534",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "533",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "EligibleEventDay"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "534",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "hasHyperglycemicEvent"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "\n      )"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "540",
                                    "locator" : "229:3-238:3",
                                    "type" : "If",
                                    "condition" : {
                                        "localId" : "514",
                                        "locator" : "229:6-229:58",
                                        "type" : "In",
                                        "operand" : [
                                            {
                                                "localId" : "511",
                                                "locator" : "229:6-229:27",
                                                "path" : "id",
                                                "type" : "Property",
                                                "source" : {
                                                    "localId" : "510",
                                                    "locator" : "229:6-229:24",
                                                    "name" : "QualifyingEncounter",
                                                    "type" : "OperandRef"
                                                }
                                            },
                                            {
                                                "localId" : "513",
                                                "locator" : "229:32-229:58",
                                                "type" : "Query",
                                                "source" : [
                                                    {
                                                        "alias" : "$this",
                                                        "expression" : {
                                                            "localId" : "512",
                                                            "locator" : "229:32-229:55",
                                                            "name" : "Denominator Exclusions",
                                                            "type" : "ExpressionRef"
                                                        }
                                                    }
                                                ],
                                                "where" : {
                                                    "type" : "Not",
                                                    "operand" : {
                                                        "type" : "IsNull",
                                                        "operand" : {
                                                            "path" : "id",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "name" : "$this",
                                                                "type" : "AliasRef"
                                                            }
                                                        }
                                                    }
                                                },
                                                "return" : {
                                                    "distinct" : false,
                                                    "expression" : {
                                                        "path" : "id",
                                                        "type" : "Property",
                                                        "source" : {
                                                            "name" : "$this",
                                                            "type" : "AliasRef"
                                                        }
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    "then" : {
                                        "localId" : "524",
                                        "locator" : "229:65-232:3",
                                        "type" : "SingletonFrom",
                                        "operand" : {
                                            "localId" : "523",
                                            "locator" : "229:80-232:3",
                                            "type" : "Query",
                                            "source" : [
                                                {
                                                    "localId" : "516",
                                                    "locator" : "229:82-229:136",
                                                    "alias" : "EncounterWithEventDays",
                                                    "expression" : {
                                                        "localId" : "515",
                                                        "locator" : "229:82-229:113",
                                                        "name" : "Days with Hyperglycemic Events",
                                                        "type" : "ExpressionRef"
                                                    }
                                                }
                                            ],
                                            "relationship" : [

                                            ],
                                            "where" : {
                                                "localId" : "520",
                                                "locator" : "230:7-230:66",
                                                "type" : "Equal",
                                                "operand" : [
                                                    {
                                                        "localId" : "518",
                                                        "locator" : "230:13-230:44",
                                                        "path" : "encounter",
                                                        "scope" : "EncounterWithEventDays",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "519",
                                                        "locator" : "230:48-230:66",
                                                        "name" : "QualifyingEncounter",
                                                        "type" : "OperandRef"
                                                    }
                                                ]
                                            },
                                            "return" : {
                                                "localId" : "522",
                                                "locator" : "231:7-231:14",
                                                "expression" : {
                                                    "localId" : "521",
                                                    "locator" : "231:14",
                                                    "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                    "value" : "0",
                                                    "type" : "Literal"
                                                }
                                            }
                                        }
                                    },
                                    "else" : {
                                        "localId" : "539",
                                        "locator" : "233:10-238:3",
                                        "type" : "SingletonFrom",
                                        "operand" : {
                                            "localId" : "538",
                                            "locator" : "233:25-238:3",
                                            "type" : "Query",
                                            "source" : [
                                                {
                                                    "localId" : "526",
                                                    "locator" : "233:27-233:81",
                                                    "alias" : "EncounterWithEventDays",
                                                    "expression" : {
                                                        "localId" : "525",
                                                        "locator" : "233:27-233:58",
                                                        "name" : "Days with Hyperglycemic Events",
                                                        "type" : "ExpressionRef"
                                                    }
                                                }
                                            ],
                                            "relationship" : [

                                            ],
                                            "where" : {
                                                "localId" : "530",
                                                "locator" : "234:7-234:66",
                                                "type" : "Equal",
                                                "operand" : [
                                                    {
                                                        "localId" : "528",
                                                        "locator" : "234:13-234:44",
                                                        "path" : "encounter",
                                                        "scope" : "EncounterWithEventDays",
                                                        "type" : "Property"
                                                    },
                                                    {
                                                        "localId" : "529",
                                                        "locator" : "234:48-234:66",
                                                        "name" : "QualifyingEncounter",
                                                        "type" : "OperandRef"
                                                    }
                                                ]
                                            },
                                            "return" : {
                                                "localId" : "537",
                                                "locator" : "235:7-237:7",
                                                "expression" : {
                                                    "localId" : "536",
                                                    "locator" : "235:14-237:7",
                                                    "type" : "Count",
                                                    "source" : {
                                                        "localId" : "535",
                                                        "locator" : "235:20-236:54",
                                                        "type" : "Query",
                                                        "source" : [
                                                            {
                                                                "localId" : "532",
                                                                "locator" : "235:20-235:76",
                                                                "alias" : "EligibleEventDay",
                                                                "expression" : {
                                                                    "localId" : "531",
                                                                    "locator" : "235:20-235:59",
                                                                    "path" : "eligibleEventDays",
                                                                    "scope" : "EncounterWithEventDays",
                                                                    "type" : "Property"
                                                                }
                                                            }
                                                        ],
                                                        "relationship" : [

                                                        ],
                                                        "where" : {
                                                            "localId" : "534",
                                                            "locator" : "236:11-236:54",
                                                            "path" : "hasHyperglycemicEvent",
                                                            "scope" : "EligibleEventDay",
                                                            "type" : "Property"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "QualifyingEncounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "509",
                                            "locator" : "228:62-228:83",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                }
            },
            "cql" : "library HospitalHarmHyperglycemiainHospitalizedPatients version '2.0.027'\r\n\r\nusing QDM version '5.6'\r\n\r\ninclude MATGlobalCommonFunctions version '7.0.000' called Global\r\n\r\nvalueset \"Diabetes\": 'urn:oid:2.16.840.1.113883.3.464.1003.103.12.1001'\r\nvalueset \"Encounter Inpatient\": 'urn:oid:2.16.840.1.113883.3.666.5.307'\r\nvalueset \"Ethnicity\": 'urn:oid:2.16.840.1.114222.4.11.837'\r\nvalueset \"Glucose Lab Test Mass Per Volume\": 'urn:oid:2.16.840.1.113762.1.4.1248.34'\r\nvalueset \"Hypoglycemics Treatment Medications\": 'urn:oid:2.16.840.1.113762.1.4.1196.394'\r\nvalueset \"ONC Administrative Sex\": 'urn:oid:2.16.840.1.113762.1.4.1'\r\nvalueset \"Payer\": 'urn:oid:2.16.840.1.114222.4.11.3591'\r\nvalueset \"Race\": 'urn:oid:2.16.840.1.114222.4.11.836'\r\n\r\nparameter \"Measurement Period\" Interval<DateTime>\r\n\r\ncontext Patient\r\n\r\ndefine \"Days in Hospitalization\":\r\n  \"Measurement Population\" EligibleInpatientHospitalization\r\n    let period: Global.\"HospitalizationWithObservation\" ( EligibleInpatientHospitalization ),\r\n    relevantPeriod: \"Hospital Days Max 10\"(period)\r\n    return Tuple {\r\n      encounter: EligibleInpatientHospitalization,\r\n      hospitalizationPeriod: period,\r\n      relevantPeriod: relevantPeriod,\r\n      relevantDays: \"Days In Period\"(relevantPeriod)\r\n    }\r\n\r\ndefine \"Days with Glucose Results\":\r\n  \"Days in Hospitalization\" InpatientHospitalDays\r\n    return Tuple {\r\n      encounter: InpatientHospitalDays.encounter,\r\n      relevantPeriod: InpatientHospitalDays.relevantPeriod,\r\n      relevantDays: ( InpatientHospitalDays.relevantDays EncounterDay\r\n          return Tuple {\r\n            dayNumber: EncounterDay.dayNumber,\r\n            dayPeriod: EncounterDay.dayPeriod,\r\n            hasSevereResult: exists ( [\"Laboratory Test, Performed\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\r\n                where GlucoseTest.result > 300 'mg/dL'\r\n                  and Global.\"EarliestOf\" ( GlucoseTest.relevantDatetime, GlucoseTest.relevantPeriod ) during EncounterDay.dayPeriod\r\n            ),\r\n            hasElevatedResult: exists ( [\"Laboratory Test, Performed\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\r\n                where GlucoseTest.result >= 200 'mg/dL'\r\n                  and Global.\"EarliestOf\" ( GlucoseTest.relevantDatetime, GlucoseTest.relevantPeriod ) during EncounterDay.dayPeriod\r\n            ),\r\n            hasNoGlucoseTest: not exists ( [\"Laboratory Test, Performed\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\r\n                where Global.\"EarliestOf\" ( GlucoseTest.relevantDatetime, GlucoseTest.relevantPeriod ) during EncounterDay.dayPeriod\r\n            )\r\n          }\r\n      )\r\n    }\n\n/*# days with hyper events uses \"Days With Glucose Results\" to find if hyper event on each day. Skips 1st day in 'RelevantDays`. Returns boolean based on: Today high result OR Today no result AND Yesterday high result AND 2 days ago high result*/\r\n\r\ndefine \"Days with Hyperglycemic Events\":\r\n  \"Days with Glucose Results\" EncounterWithResultDays\r\n    let eligibleEventDays: EncounterWithResultDays.relevantDays EncounterDay\r\n      where EncounterDay.dayNumber > 1\r\n      return Tuple {\r\n        dayNumber: EncounterDay.dayNumber,\r\n        dayPeriod: EncounterDay.dayPeriod,\r\n        hasHyperglycemicEvent: ( EncounterDay.hasSevereResult\r\n            or ( EncounterDay.hasNoGlucoseTest\r\n                and EncounterWithResultDays.relevantDays[EncounterDay.dayNumber - 2].hasElevatedResult\r\n                and EncounterWithResultDays.relevantDays[EncounterDay.dayNumber - 3].hasElevatedResult\r\n            )\r\n        )\r\n      }\r\n    return Tuple {\r\n      encounter: EncounterWithResultDays.encounter,\r\n      relevantPeriod: EncounterWithResultDays.relevantPeriod,\r\n      eligibleEventDays: eligibleEventDays\r\n    }\r\n\r\ndefine \"Denominator\":\r\n  \"Initial Population\"\r\n\r\ndefine \"Denominator Exclusions\":\r\n  \"Encounter with First Glucose Greater Than or Equal to 1000\"\n\n/** Using the already calculated pairing of hospitalization periods with encounters, filter on ones with any elevated (>= 200) glucose reading during the hospitalization **/\r\n\r\ndefine \"Encounter with Elevated Glucose Greater Than or Equal to 200\":\r\n  \"Encounter with Hospitalization Period\" Hospitalization\r\n    with [\"Laboratory Test, Performed\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\r\n      such that Global.\"EarliestOf\" ( GlucoseTest.relevantDatetime, GlucoseTest.relevantPeriod ) during Hospitalization.hospitalizationPeriod\r\n        and GlucoseTest.result >= 200 'mg/dL'\r\n    return Hospitalization.encounter\n\n/** Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * diabetes and return the encounter.*/\r\n\r\ndefine \"Encounter with Existing Diabetes Diagnosis\":\r\n  \"Encounter with Hospitalization Period\" Hospitalization\r\n    with [\"Diagnosis\": \"Diabetes\"] DiabetesCondition\r\n      such that DiabetesCondition.prevalencePeriod starts before \r\n      end of Hospitalization.hospitalizationPeriod\r\n    return Hospitalization.encounter\r\n\r\ndefine \"Encounter with First Glucose Greater Than or Equal to 1000\":\r\n  \"Initial Population\" InpatientHospitalization\r\n    with \"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\" FirstGlucoseResult\r\n      such that FirstGlucoseResult.result >= 1000 'mg/dL'\r\n        and Global.\"EarliestOf\" ( FirstGlucoseResult.relevantDatetime, FirstGlucoseResult.relevantPeriod ) during Interval[( start of Global.\"HospitalizationWithObservation\" ( InpatientHospitalization ) - 1 hour ), ( start of Global.\"HospitalizationWithObservation\" ( InpatientHospitalization ) + 6 hours )]\r\n    return InpatientHospitalization\n\n/** Create paring of encounters to hospitalization period so this calculation can be inspected and the result \n * can be reused, making the logic faster.*/\r\n\r\ndefine \"Encounter with Hospitalization Period\":\r\n  \"Qualifying Encounter\" QualifyingHospitalization\r\n    return Tuple {\r\n      encounter: QualifyingHospitalization,\r\n      hospitalizationPeriod: Global.\"HospitalizationWithObservation\" ( QualifyingHospitalization )\r\n    }\r\n\r\ndefine \"Encounter with Hyperglycemic Events\":\r\n  \"Days with Hyperglycemic Events\" HyperglycemicEventDays\r\n    where exists ( HyperglycemicEventDays.eligibleEventDays EligibleEventDay\r\n        where EligibleEventDay.hasHyperglycemicEvent\r\n    )\r\n    return HyperglycemicEventDays.encounter\r\n\r\ndefine \"Encounter with Hypoglycemic Medication\":\r\n  \"Encounter with Hospitalization Period\" Hospitalization\r\n    with [\"Medication, Administered\": \"Hypoglycemics Treatment Medications\"] HypoglycemicMedication\r\n      such that Global.\"NormalizeInterval\" ( HypoglycemicMedication.relevantDatetime, HypoglycemicMedication.relevantPeriod ) starts during Hospitalization.hospitalizationPeriod\r\n    return Hospitalization.encounter\r\n\r\ndefine \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\r\n  from\r\n    \"Initial Population\" InpatientHospitalization,\r\n    [\"Laboratory Test, Performed\": \"Glucose Lab Test Mass Per Volume\"] GlucoseTest\r\n    let HospitalizationInterval: Global.\"HospitalizationWithObservation\" ( InpatientHospitalization ),\r\n    GlucoseTestTime: Global.\"EarliestOf\" ( GlucoseTest.relevantDatetime, GlucoseTest.relevantPeriod )\r\n    where GlucoseTest.result >= 1000 'mg/dL'\r\n      and GlucoseTestTime during Interval[( start of HospitalizationInterval - 1 hour ), ( start of HospitalizationInterval + 6 hours )]\r\n    return GlucoseTest\r\n\r\ndefine \"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\r\n  from\r\n    \"Initial Population\" InpatientHospitalization,\r\n    \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\" GlucoseResult1000,\r\n    [\"Laboratory Test, Performed\": \"Glucose Lab Test Mass Per Volume\"] EarlierGlucoseTest\r\n    let HospitalizationInterval: Global.\"HospitalizationWithObservation\" ( InpatientHospitalization ),\r\n    GlucoseTest1000Time: Global.\"EarliestOf\" ( GlucoseResult1000.relevantDatetime, GlucoseResult1000.relevantPeriod ),\r\n    EarlierGlucoseTestTime: Global.\"EarliestOf\" ( EarlierGlucoseTest.relevantDatetime, EarlierGlucoseTest.relevantPeriod )\r\n    where GlucoseTest1000Time during Interval[( start of HospitalizationInterval - 1 hour ), ( start of HospitalizationInterval + 6 hour )]\r\n      and EarlierGlucoseTestTime during Interval[( start of HospitalizationInterval - 1 hour ), GlucoseTest1000Time )\r\n      and EarlierGlucoseTest.id !~ GlucoseResult1000.id\r\n    return GlucoseResult1000\r\n\r\ndefine \"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\r\n  \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\" GlucoseResult1000\r\n    where not ( GlucoseResult1000.id in \"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\".id )\r\n\r\ndefine \"Initial Population\":\r\n  \"Encounter with Existing Diabetes Diagnosis\"\r\n    union \"Encounter with Hypoglycemic Medication\"\r\n    union \"Encounter with Elevated Glucose Greater Than or Equal to 200\"\r\n\r\ndefine \"Measurement Population\":\r\n  \"Denominator\"\r\n\r\ndefine \"Numerator\":\r\n  \"Encounter with Hyperglycemic Events\"\r\n\r\ndefine \"Qualifying Encounter\":\r\n  [\"Encounter, Performed\": \"Encounter Inpatient\"] InpatientEncounter\r\n    where InpatientEncounter.relevantPeriod ends during day of \"Measurement Period\"\r\n      and AgeInYearsAt(date from start of InpatientEncounter.relevantPeriod)>= 18\r\n\r\ndefine \"SDE Ethnicity\":\r\n  [\"Patient Characteristic Ethnicity\": \"Ethnicity\"]\r\n\r\ndefine \"SDE Payer\":\r\n  [\"Patient Characteristic Payer\": \"Payer\"]\r\n\r\ndefine \"SDE Race\":\r\n  [\"Patient Characteristic Race\": \"Race\"]\r\n\r\ndefine \"SDE Sex\":\r\n  [\"Patient Characteristic Sex\": \"ONC Administrative Sex\"]\n\n/** Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\n * the final day if it is less than 24 hours. This also includes the first 24 hour period.*/\r\n\r\ndefine function \"Interval To Day Numbers\"(Period Interval<DateTime>):\r\n  ( expand { Interval[1, days between start of Period and \r\n  end of Period]} ) DayExpand\r\n    return \r\n    end of DayExpand\n\n/**\n * Crops an interval to a maximum length of 10 days.*/\r\n\r\ndefine function \"Hospital Days Max 10\"(Period Interval<DateTime>):\r\n  Interval[start of Period, Min({ \r\n    end of Period, start of Period + 10 days }\r\n  )]\n\n/**\n * Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.*/\r\n\r\ndefine function \"Days In Period\"(Period Interval<DateTime>):\r\n  ( \"Interval To Day Numbers\"(Period)) DayNumber\r\n    let startPeriod: start of Period + ( 24 hours * ( DayNumber - 1 ) ),\r\n    endPeriod: if ( hours between startPeriod and \r\n      end of Period < 24\r\n    ) then startPeriod \r\n      else start of Period + ( 24 hours * DayNumber )\r\n    return Tuple {\r\n      dayNumber: DayNumber,\r\n      dayPeriod: Interval[startPeriod, endPeriod )\r\n    }\n\n/**\n * Counts the number of eligible days in an encounter. This simply filters and counts the data built in\n * \"Days With Glucose Results\".*/\r\n\r\ndefine function \"Denominator Observations\"(QualifyingEncounter \"Encounter, Performed\"):\r\n  if QualifyingEncounter.id in \"Denominator Exclusions\".id then singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\r\n      where EncounterWithEventDays.encounter = QualifyingEncounter\r\n      return 0\r\n  ) \r\n    else singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\r\n      where EncounterWithEventDays.encounter = QualifyingEncounter\r\n      return Count(EncounterWithEventDays.eligibleEventDays)\r\n  )\n\n/**\n * Counts the number of eligible days with a hyperglycemic event in an encounter. This simply filters and counts the data built in\n * \"Days With Hyperglycemic Events\".*/\r\n\r\ndefine function \"Numerator Observations\"(QualifyingEncounter \"Encounter, Performed\"):\r\n  if QualifyingEncounter.id in \"Denominator Exclusions\".id then singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\r\n      where EncounterWithEventDays.encounter = QualifyingEncounter\r\n      return 0\r\n  ) \r\n    else singleton from ( \"Days with Hyperglycemic Events\" EncounterWithEventDays\r\n      where EncounterWithEventDays.encounter = QualifyingEncounter\r\n      return Count(EncounterWithEventDays.eligibleEventDays EligibleEventDay\r\n          where EligibleEventDay.hasHyperglycemicEvent\r\n      )\r\n  )",
            "elm_annotations" : {
                "statements" : [
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Qualifying Encounter\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Encounter, Performed\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Encounter Inpatient\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "14"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "14"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " InpatientEncounter"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "15"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "where "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "InpatientEncounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "16"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "relevantPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "17"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "17"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " ends during day of "
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "19"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Measurement Period\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "ParameterRef",
                                                                        "ref_id" : "18"
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "19"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n      and "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "AgeInYearsAt("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "date from "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "start of "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "InpatientEncounter"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "20"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "relevantPeriod"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "21"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "21"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Start",
                                                                                        "ref_id" : "22"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "DateFrom",
                                                                                "ref_id" : "23"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "CalculateAgeAt",
                                                                        "ref_id" : "24"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ">= 18"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Literal",
                                                                        "ref_id" : "25"
                                                                    }
                                                                ],
                                                                "node_type" : "GreaterOrEqual",
                                                                "ref_id" : "26"
                                                            }
                                                        ],
                                                        "ref_id" : "27"
                                                    }
                                                ],
                                                "ref_id" : "27"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "28"
                                    }
                                ],
                                "ref_id" : "29"
                            }
                        ],
                        "define_name" : "Qualifying Encounter"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/** Create paring of encounters to hospitalization period so this calculation can be inspected and the result \n * can be reused, making the logic faster.*/define \"Encounter with Hospitalization Period\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Qualifying Encounter\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "30"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " QualifyingHospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "31"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "Tuple {\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "QualifyingHospitalization"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "32"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "hospitalizationPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Global"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "33"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"HospitalizationWithObservation\" ( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "QualifyingHospitalization"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "AliasRef",
                                                                                        "ref_id" : "34"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "35"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "35"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n    }"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "Tuple",
                                                        "ref_id" : "36"
                                                    }
                                                ],
                                                "ref_id" : "37"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "38"
                                    }
                                ],
                                "ref_id" : "39"
                            }
                        ],
                        "define_name" : "Encounter with Hospitalization Period"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/** Using the already calculated pairing of hospitalization periods with encounters, filter on ones with \n * diabetes and return the encounter.*/define \"Encounter with Existing Diabetes Diagnosis\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Encounter with Hospitalization Period\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "40"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " Hospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "41"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "with "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Diagnosis\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Diabetes\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "42"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "42"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " DiabetesCondition"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "43"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n      such that "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "DiabetesCondition"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "44"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "prevalencePeriod"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "45"
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "45"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " starts before \n      "
                                                                    }
                                                                ],
                                                                "node_type" : "Before",
                                                                "ref_id" : "49"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "end of "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Hospitalization"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "46"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "hospitalizationPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "47"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "47"
                                                                    }
                                                                ],
                                                                "node_type" : "End",
                                                                "ref_id" : "48"
                                                            }
                                                        ],
                                                        "node_type" : "Before",
                                                        "ref_id" : "49"
                                                    }
                                                ],
                                                "ref_id" : "50"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Hospitalization"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "51"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "52"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "52"
                                                    }
                                                ],
                                                "ref_id" : "53"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "54"
                                    }
                                ],
                                "ref_id" : "55"
                            }
                        ],
                        "define_name" : "Encounter with Existing Diabetes Diagnosis"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Encounter with Hypoglycemic Medication\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Encounter with Hospitalization Period\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "57"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " Hospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "58"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "with "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Medication, Administered\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Hypoglycemics Treatment Medications\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "59"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "59"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " HypoglycemicMedication"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "60"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n      such that "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "61"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"NormalizeInterval\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "HypoglycemicMedication"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "62"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantDatetime"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "63"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "63"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "HypoglycemicMedication"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "64"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "65"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "65"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "66"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "66"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " starts during "
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "69"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Hospitalization"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "67"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "hospitalizationPeriod"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "68"
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "68"
                                                            }
                                                        ],
                                                        "node_type" : "In",
                                                        "ref_id" : "69"
                                                    }
                                                ],
                                                "ref_id" : "70"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Hospitalization"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "71"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "72"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "72"
                                                    }
                                                ],
                                                "ref_id" : "73"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "74"
                                    }
                                ],
                                "ref_id" : "75"
                            }
                        ],
                        "define_name" : "Encounter with Hypoglycemic Medication"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/** Using the already calculated pairing of hospitalization periods with encounters, filter on ones with any elevated (>= 200) glucose reading during the hospitalization **/define \"Encounter with Elevated Glucose Greater Than or Equal to 200\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Encounter with Hospitalization Period\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "78"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " Hospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "79"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "with "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Laboratory Test, Performed\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Glucose Lab Test Mass Per Volume\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "80"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "80"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " GlucoseTest"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "81"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n      such that "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Global"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "82"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"EarliestOf\" ( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "GlucoseTest"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "83"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantDatetime"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "84"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "84"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ", "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "GlucoseTest"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "85"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "86"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "86"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "FunctionRef",
                                                                                "ref_id" : "87"
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "87"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " during "
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "90"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Hospitalization"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "88"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "hospitalizationPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "89"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "89"
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "90"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n        and "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "GlucoseTest"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "91"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "result"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "92"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "92"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " >= "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "200 'mg/dL'"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Quantity",
                                                                        "ref_id" : "93"
                                                                    }
                                                                ],
                                                                "node_type" : "GreaterOrEqual",
                                                                "ref_id" : "94"
                                                            }
                                                        ],
                                                        "node_type" : "And",
                                                        "ref_id" : "95"
                                                    }
                                                ],
                                                "ref_id" : "96"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Hospitalization"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "97"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "98"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "98"
                                                    }
                                                ],
                                                "ref_id" : "99"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "100"
                                    }
                                ],
                                "ref_id" : "101"
                            }
                        ],
                        "define_name" : "Encounter with Elevated Glucose Greater Than or Equal to 200"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Initial Population\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\"Encounter with Existing Diabetes Diagnosis\""
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "ExpressionRef",
                                                        "ref_id" : "56"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    union "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\"Encounter with Hypoglycemic Medication\""
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "ExpressionRef",
                                                        "ref_id" : "76"
                                                    }
                                                ],
                                                "node_type" : "Union",
                                                "ref_id" : "77"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    union "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"Encounter with Elevated Glucose Greater Than or Equal to 200\""
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "ExpressionRef",
                                                "ref_id" : "102"
                                            }
                                        ],
                                        "node_type" : "Union",
                                        "ref_id" : "103"
                                    }
                                ],
                                "ref_id" : "104"
                            }
                        ],
                        "define_name" : "Initial Population"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Denominator\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Initial Population\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "ExpressionRef",
                                        "ref_id" : "105"
                                    }
                                ],
                                "ref_id" : "106"
                            }
                        ],
                        "define_name" : "Denominator"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Measurement Population\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Denominator\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "ExpressionRef",
                                        "ref_id" : "107"
                                    }
                                ],
                                "ref_id" : "108"
                            }
                        ],
                        "define_name" : "Measurement Population"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/**\n * Crops an interval to a maximum length of 10 days.*/define function \"Hospital Days Max 10\"(Period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "116"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "117"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "Interval["
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "start of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "118"
                                                            }
                                                        ],
                                                        "ref_id" : "119"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ", "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "Min("
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "{ \n    "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "end of "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Period"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "OperandRef",
                                                                                "ref_id" : "120"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "121"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ", "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "122"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "123"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " + "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "10 days"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Quantity",
                                                                                "ref_id" : "124"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "125"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " }"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "126"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n  )"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "127"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "]"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "Interval",
                                                "ref_id" : "128"
                                            }
                                        ],
                                        "node_type" : "Interval",
                                        "ref_id" : "128"
                                    }
                                ],
                                "ref_id" : "129"
                            }
                        ],
                        "define_name" : "Hospital Days Max 10"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/** Creates a list of integers from 1 to how many days are in the interval. Note, this wont create an index for\n * the final day if it is less than 24 hours. This also includes the first 24 hour period.*/define function \"Interval To Day Numbers\"(Period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "139"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "140"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "expand "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "{ "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Interval[1, "
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "141"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "days between "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "start of "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "Period"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "OperandRef",
                                                                                                                        "ref_id" : "142"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Start",
                                                                                                                "ref_id" : "143"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " and \n  "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "end of "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "Period"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "OperandRef",
                                                                                                                        "ref_id" : "144"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "End",
                                                                                                                "ref_id" : "145"
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "146"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "]"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "147"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "}"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "List",
                                                                                        "ref_id" : "148"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Expand",
                                                                                "ref_id" : "149"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Expand",
                                                                        "ref_id" : "149"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " DayExpand"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "150"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "return \n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "end of "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "DayExpand"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "AliasRef",
                                                                        "ref_id" : "151"
                                                                    }
                                                                ],
                                                                "node_type" : "End",
                                                                "ref_id" : "152"
                                                            }
                                                        ],
                                                        "ref_id" : "153"
                                                    }
                                                ],
                                                "node_type" : "Query",
                                                "ref_id" : "154"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "154"
                                    }
                                ],
                                "ref_id" : "155"
                            }
                        ],
                        "define_name" : "Interval To Day Numbers"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/**\n * Creates a list of 24 hour long intervals in an interval paired with the index (1 indexed) to which 24 hour interval it is.*/define function \"Days In Period\"(Period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "136"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "137"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Interval To Day Numbers\"("
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "138"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ")"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "FunctionRef",
                                                                                "ref_id" : "156"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "156"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " DayNumber"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "157"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "let "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "startPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "158"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "159"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " + "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "24 hours"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Quantity",
                                                                                                "ref_id" : "160"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " * "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "( "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "DayNumber"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "AliasRef",
                                                                                                                "ref_id" : "161"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " - 1"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Literal",
                                                                                                                "ref_id" : "162"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Subtract",
                                                                                                        "ref_id" : "163"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " )"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Subtract",
                                                                                                "ref_id" : "163"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Multiply",
                                                                                        "ref_id" : "164"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Multiply",
                                                                                "ref_id" : "164"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Add",
                                                                        "ref_id" : "165"
                                                                    }
                                                                ],
                                                                "ref_id" : "166"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "endPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "if "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "hours between "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "startPeriod"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "QueryLetRef",
                                                                                                        "ref_id" : "167"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " and \n      "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "Period"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "OperandRef",
                                                                                                                "ref_id" : "168"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "169"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "DurationBetween",
                                                                                                "ref_id" : "170"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " < 24"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Literal",
                                                                                                "ref_id" : "171"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "172"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n    )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "172"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " then "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "startPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "173"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " \n      else "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "start of "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Period"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "OperandRef",
                                                                                                "ref_id" : "174"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Start",
                                                                                        "ref_id" : "175"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " + "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "( "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "24 hours"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Quantity",
                                                                                                        "ref_id" : "176"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " * "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "DayNumber"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "AliasRef",
                                                                                                        "ref_id" : "177"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Multiply",
                                                                                                "ref_id" : "178"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " )"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Multiply",
                                                                                        "ref_id" : "178"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "179"
                                                                            }
                                                                        ],
                                                                        "node_type" : "If",
                                                                        "ref_id" : "180"
                                                                    }
                                                                ],
                                                                "ref_id" : "181"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "return "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Tuple {\n      "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "dayNumber: "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "DayNumber"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "182"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ",\n      "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "dayPeriod: "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Interval["
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "startPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "183"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ", "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "endPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "184"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "185"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n    }"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Tuple",
                                                                "ref_id" : "186"
                                                            }
                                                        ],
                                                        "ref_id" : "187"
                                                    }
                                                ],
                                                "node_type" : "Query",
                                                "ref_id" : "188"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "188"
                                    }
                                ],
                                "ref_id" : "189"
                            }
                        ],
                        "define_name" : "Days In Period"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Days in Hospitalization\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Measurement Population\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "109"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " EligibleInpatientHospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "110"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "let "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "period: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "111"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"HospitalizationWithObservation\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EligibleInpatientHospitalization"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "AliasRef",
                                                                                "ref_id" : "112"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "113"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "113"
                                                            }
                                                        ],
                                                        "ref_id" : "114"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "relevantPeriod: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\"Hospital Days Max 10\"("
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "QueryLetRef",
                                                                        "ref_id" : "115"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ")"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "130"
                                                            }
                                                        ],
                                                        "ref_id" : "131"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "Tuple {\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "EligibleInpatientHospitalization"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "132"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "hospitalizationPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "133"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "relevantPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "relevantPeriod"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "134"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "relevantDays: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Days In Period\"("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "relevantPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "135"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "190"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n    }"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "Tuple",
                                                        "ref_id" : "191"
                                                    }
                                                ],
                                                "ref_id" : "192"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "193"
                                    }
                                ],
                                "ref_id" : "194"
                            }
                        ],
                        "define_name" : "Days in Hospitalization"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Days with Glucose Results\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Days in Hospitalization\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "195"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " InpatientHospitalDays"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "196"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "Tuple {\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "InpatientHospitalDays"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "197"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "encounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "198"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "198"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "relevantPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "InpatientHospitalDays"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "199"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "relevantPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "200"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "200"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "relevantDays: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "InpatientHospitalDays.relevantDays"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "201"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " EncounterDay"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "202"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n          "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "return "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Tuple {\n            "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "dayNumber: "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "203"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "dayNumber"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "204"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "204"
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ",\n            "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "dayPeriod: "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "205"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "dayPeriod"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "206"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "206"
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ",\n            "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "hasSevereResult: "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "exists "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "( "
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "[\"Laboratory Test, Performed\": "
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "\"Glucose Lab Test Mass Per Volume\""
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "]"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Retrieve",
                                                                                                                                                                "ref_id" : "207"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Retrieve",
                                                                                                                                                        "ref_id" : "207"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : " GlucoseTest"
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "208"
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "\n                "
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "where "
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "209"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "result"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                        "ref_id" : "210"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "210"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " > "
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "300 'mg/dL'"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Quantity",
                                                                                                                                                                "ref_id" : "211"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Greater",
                                                                                                                                                        "ref_id" : "212"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "\n                  and "
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "Global"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "213"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "\"EarliestOf\" ( "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "ref_id" : "214"
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "."
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "relevantDatetime"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                                        "ref_id" : "215"
                                                                                                                                                                                    }
                                                                                                                                                                                ],
                                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                                "ref_id" : "215"
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : ", "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "ref_id" : "216"
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "."
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                                        "ref_id" : "217"
                                                                                                                                                                                    }
                                                                                                                                                                                ],
                                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                                "ref_id" : "217"
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : " )"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "FunctionRef",
                                                                                                                                                                        "ref_id" : "218"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "FunctionRef",
                                                                                                                                                                "ref_id" : "218"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " during "
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "In",
                                                                                                                                                                "ref_id" : "221"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "219"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "dayPeriod"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                        "ref_id" : "220"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "220"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "In",
                                                                                                                                                        "ref_id" : "221"
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "222"
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "ref_id" : "222"
                                                                                                                                    }
                                                                                                                                ],
                                                                                                                                "node_type" : "Query",
                                                                                                                                "ref_id" : "223"
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\n            )"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Query",
                                                                                                                        "ref_id" : "223"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "224"
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ",\n            "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "hasElevatedResult: "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "exists "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "( "
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "[\"Laboratory Test, Performed\": "
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "\"Glucose Lab Test Mass Per Volume\""
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "]"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Retrieve",
                                                                                                                                                                "ref_id" : "225"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Retrieve",
                                                                                                                                                        "ref_id" : "225"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : " GlucoseTest"
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "226"
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "\n                "
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "where "
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "227"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "result"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                        "ref_id" : "228"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "228"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " >= "
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "200 'mg/dL'"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Quantity",
                                                                                                                                                                "ref_id" : "229"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "GreaterOrEqual",
                                                                                                                                                        "ref_id" : "230"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "\n                  and "
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "Global"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "231"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "\"EarliestOf\" ( "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "ref_id" : "232"
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "."
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "relevantDatetime"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                                        "ref_id" : "233"
                                                                                                                                                                                    }
                                                                                                                                                                                ],
                                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                                "ref_id" : "233"
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : ", "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "ref_id" : "234"
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "."
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                                        "ref_id" : "235"
                                                                                                                                                                                    }
                                                                                                                                                                                ],
                                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                                "ref_id" : "235"
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : " )"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "FunctionRef",
                                                                                                                                                                        "ref_id" : "236"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "FunctionRef",
                                                                                                                                                                "ref_id" : "236"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " during "
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "In",
                                                                                                                                                                "ref_id" : "239"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "237"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "dayPeriod"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                        "ref_id" : "238"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "238"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "In",
                                                                                                                                                        "ref_id" : "239"
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "240"
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "ref_id" : "240"
                                                                                                                                    }
                                                                                                                                ],
                                                                                                                                "node_type" : "Query",
                                                                                                                                "ref_id" : "241"
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\n            )"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Query",
                                                                                                                        "ref_id" : "241"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "242"
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ",\n            "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "hasNoGlucoseTest: "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "not "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "exists "
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "( "
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "[\"Laboratory Test, Performed\": "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "\"Glucose Lab Test Mass Per Volume\""
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "]"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Retrieve",
                                                                                                                                                                        "ref_id" : "243"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Retrieve",
                                                                                                                                                                "ref_id" : "243"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " GlucoseTest"
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "ref_id" : "244"
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "\n                "
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "where "
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "Global"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "245"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "\"EarliestOf\" ( "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "ref_id" : "246"
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "."
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "relevantDatetime"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                                        "ref_id" : "247"
                                                                                                                                                                                    }
                                                                                                                                                                                ],
                                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                                "ref_id" : "247"
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : ", "
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "GlucoseTest"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "ref_id" : "248"
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "text" : "."
                                                                                                                                                                                            }
                                                                                                                                                                                        ]
                                                                                                                                                                                    },
                                                                                                                                                                                    {
                                                                                                                                                                                        "children" : [
                                                                                                                                                                                            {
                                                                                                                                                                                                "children" : [
                                                                                                                                                                                                    {
                                                                                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                                                                                    }
                                                                                                                                                                                                ]
                                                                                                                                                                                            }
                                                                                                                                                                                        ],
                                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                                        "ref_id" : "249"
                                                                                                                                                                                    }
                                                                                                                                                                                ],
                                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                                "ref_id" : "249"
                                                                                                                                                                            },
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : " )"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "FunctionRef",
                                                                                                                                                                        "ref_id" : "250"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "FunctionRef",
                                                                                                                                                                "ref_id" : "250"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " during "
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "ref_id" : "253"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "251"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "dayPeriod"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                        "ref_id" : "252"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "252"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "ref_id" : "253"
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "253"
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "node_type" : "Query",
                                                                                                                                        "ref_id" : "254"
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "\n            )"
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    }
                                                                                                                                ],
                                                                                                                                "node_type" : "Query",
                                                                                                                                "ref_id" : "254"
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Exists",
                                                                                                                        "ref_id" : "255"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "256"
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "\n          }"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Tuple",
                                                                                                "ref_id" : "257"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "258"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "259"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "259"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n    }"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "Tuple",
                                                        "ref_id" : "260"
                                                    }
                                                ],
                                                "ref_id" : "261"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "262"
                                    }
                                ],
                                "ref_id" : "263"
                            }
                        ],
                        "define_name" : "Days with Glucose Results"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*# days with hyper events uses \"Days With Glucose Results\" to find if hyper event on each day. Skips 1st day in 'RelevantDays`. Returns boolean based on: Today high result OR Today no result AND Yesterday high result AND 2 days ago high result*/define \"Days with Hyperglycemic Events\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Days with Glucose Results\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "264"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " EncounterWithResultDays"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "265"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "let "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "eligibleEventDays: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EncounterWithResultDays.relevantDays"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "266"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " EncounterDay"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "267"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n      "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "where "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EncounterDay"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "268"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "dayNumber"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "269"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "269"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " > 1"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Literal",
                                                                                        "ref_id" : "270"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "271"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "271"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n      "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "return "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Tuple {\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "dayNumber: "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterDay"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "272"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "dayNumber"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "273"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "273"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ",\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "dayPeriod: "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterDay"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "274"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "dayPeriod"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "275"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "275"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ",\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "hasHyperglycemicEvent: "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "( "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "276"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "hasSevereResult"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Property",
                                                                                                                        "ref_id" : "277"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "277"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\n            or "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "( "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "EncounterDay"
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "278"
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "."
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "hasNoGlucoseTest"
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "node_type" : "Property",
                                                                                                                                                "ref_id" : "279"
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "node_type" : "Property",
                                                                                                                                        "ref_id" : "279"
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "\n                and "
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "EncounterWithResultDays"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "ref_id" : "280"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : "."
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "relevantDays"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "281"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                        "ref_id" : "281"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "["
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "EncounterDay"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "ref_id" : "282"
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "."
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    },
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "children" : [
                                                                                                                                                                                    {
                                                                                                                                                                                        "text" : "dayNumber"
                                                                                                                                                                                    }
                                                                                                                                                                                ]
                                                                                                                                                                            }
                                                                                                                                                                        ],
                                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                                        "ref_id" : "283"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "283"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : " - 2"
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Literal",
                                                                                                                                                                "ref_id" : "284"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Subtract",
                                                                                                                                                        "ref_id" : "285"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "]"
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "ref_id" : "286"
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "."
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "hasElevatedResult"
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "node_type" : "Property",
                                                                                                                                                "ref_id" : "287"
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "node_type" : "Property",
                                                                                                                                        "ref_id" : "287"
                                                                                                                                    }
                                                                                                                                ],
                                                                                                                                "node_type" : "And",
                                                                                                                                "ref_id" : "288"
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\n                and "
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            },
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : "EncounterWithResultDays"
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "ref_id" : "289"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : "."
                                                                                                                                                            }
                                                                                                                                                        ]
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : "relevantDays"
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                        "ref_id" : "290"
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "node_type" : "Property",
                                                                                                                                                "ref_id" : "290"
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "["
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "EncounterDay"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "ref_id" : "291"
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "text" : "."
                                                                                                                                                                    }
                                                                                                                                                                ]
                                                                                                                                                            },
                                                                                                                                                            {
                                                                                                                                                                "children" : [
                                                                                                                                                                    {
                                                                                                                                                                        "children" : [
                                                                                                                                                                            {
                                                                                                                                                                                "text" : "dayNumber"
                                                                                                                                                                            }
                                                                                                                                                                        ]
                                                                                                                                                                    }
                                                                                                                                                                ],
                                                                                                                                                                "node_type" : "Property",
                                                                                                                                                                "ref_id" : "292"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Property",
                                                                                                                                                        "ref_id" : "292"
                                                                                                                                                    },
                                                                                                                                                    {
                                                                                                                                                        "children" : [
                                                                                                                                                            {
                                                                                                                                                                "text" : " - 3"
                                                                                                                                                            }
                                                                                                                                                        ],
                                                                                                                                                        "node_type" : "Literal",
                                                                                                                                                        "ref_id" : "293"
                                                                                                                                                    }
                                                                                                                                                ],
                                                                                                                                                "node_type" : "Subtract",
                                                                                                                                                "ref_id" : "294"
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "]"
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "ref_id" : "295"
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "."
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    },
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "children" : [
                                                                                                                                                    {
                                                                                                                                                        "text" : "hasElevatedResult"
                                                                                                                                                    }
                                                                                                                                                ]
                                                                                                                                            }
                                                                                                                                        ],
                                                                                                                                        "node_type" : "Property",
                                                                                                                                        "ref_id" : "296"
                                                                                                                                    }
                                                                                                                                ],
                                                                                                                                "node_type" : "Property",
                                                                                                                                "ref_id" : "296"
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "And",
                                                                                                                        "ref_id" : "297"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "\n            )"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "And",
                                                                                                                "ref_id" : "297"
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "298"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "\n        )"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "298"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n      }"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Tuple",
                                                                                "ref_id" : "299"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "300"
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "301"
                                                            }
                                                        ],
                                                        "ref_id" : "302"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "Tuple {\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EncounterWithResultDays"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "303"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "encounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "304"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "304"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "relevantPeriod: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EncounterWithResultDays"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "305"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "relevantPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "306"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "306"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "eligibleEventDays: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "eligibleEventDays"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "307"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n    }"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "Tuple",
                                                        "ref_id" : "308"
                                                    }
                                                ],
                                                "ref_id" : "309"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "310"
                                    }
                                ],
                                "ref_id" : "311"
                            }
                        ],
                        "define_name" : "Days with Hyperglycemic Events"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "from\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Initial Population\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "314"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " InpatientHospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "315"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Laboratory Test, Performed\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Glucose Lab Test Mass Per Volume\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "316"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "316"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " GlucoseTest"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "317"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "let "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "HospitalizationInterval: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "318"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"HospitalizationWithObservation\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "InpatientHospitalization"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "AliasRef",
                                                                                "ref_id" : "319"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "320"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "320"
                                                            }
                                                        ],
                                                        "ref_id" : "321"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "GlucoseTestTime: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "322"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"EarliestOf\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "GlucoseTest"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "323"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantDatetime"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "324"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "324"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "GlucoseTest"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "325"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "326"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "326"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "327"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "327"
                                                            }
                                                        ],
                                                        "ref_id" : "328"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "where "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "GlucoseTest"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "329"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "result"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "330"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "330"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " >= "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "1000 'mg/dL'"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Quantity",
                                                                        "ref_id" : "331"
                                                                    }
                                                                ],
                                                                "node_type" : "GreaterOrEqual",
                                                                "ref_id" : "332"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n      and "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "GlucoseTestTime"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "QueryLetRef",
                                                                        "ref_id" : "333"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " during "
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "343"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Interval["
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "HospitalizationInterval"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "QueryLetRef",
                                                                                                        "ref_id" : "334"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "335"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " - "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "1 hour"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Quantity",
                                                                                                "ref_id" : "336"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "337"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "337"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "HospitalizationInterval"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "QueryLetRef",
                                                                                                        "ref_id" : "338"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "339"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " + "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "6 hours"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Quantity",
                                                                                                "ref_id" : "340"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "341"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "341"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Interval",
                                                                        "ref_id" : "342"
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "343"
                                                            }
                                                        ],
                                                        "ref_id" : "344"
                                                    }
                                                ],
                                                "ref_id" : "344"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "GlucoseTest"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "AliasRef",
                                                        "ref_id" : "345"
                                                    }
                                                ],
                                                "ref_id" : "346"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "347"
                                    }
                                ],
                                "ref_id" : "348"
                            }
                        ],
                        "define_name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "from\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Initial Population\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "353"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " InpatientHospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "354"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "355"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " GlucoseResult1000"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "356"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Laboratory Test, Performed\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Glucose Lab Test Mass Per Volume\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "357"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "357"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " EarlierGlucoseTest"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "358"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "let "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "HospitalizationInterval: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "359"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"HospitalizationWithObservation\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "InpatientHospitalization"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "AliasRef",
                                                                                "ref_id" : "360"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "361"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "361"
                                                            }
                                                        ],
                                                        "ref_id" : "362"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "GlucoseTest1000Time: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "363"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"EarliestOf\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "GlucoseResult1000"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "364"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantDatetime"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "365"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "365"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "GlucoseResult1000"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "366"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "367"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "367"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "368"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "368"
                                                            }
                                                        ],
                                                        "ref_id" : "369"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ",\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "EarlierGlucoseTestTime: "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Global"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "370"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"EarliestOf\" ( "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "EarlierGlucoseTest"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "371"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantDatetime"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "372"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "372"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "EarlierGlucoseTest"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "373"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "374"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "374"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "375"
                                                                    }
                                                                ],
                                                                "node_type" : "FunctionRef",
                                                                "ref_id" : "375"
                                                            }
                                                        ],
                                                        "ref_id" : "376"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "where "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "GlucoseTest1000Time"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "377"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " during "
                                                                                    }
                                                                                ],
                                                                                "node_type" : "In",
                                                                                "ref_id" : "387"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Interval["
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "( "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "HospitalizationInterval"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "QueryLetRef",
                                                                                                                "ref_id" : "378"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "379"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " - "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "1 hour"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Quantity",
                                                                                                        "ref_id" : "380"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "381"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " )"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "381"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ", "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "( "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "HospitalizationInterval"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "QueryLetRef",
                                                                                                                "ref_id" : "382"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "383"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " + "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "6 hour"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Quantity",
                                                                                                        "ref_id" : "384"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "385"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " )"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "385"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "]"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Interval",
                                                                                "ref_id" : "386"
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "387"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n      and "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EarlierGlucoseTestTime"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "388"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " during "
                                                                                    }
                                                                                ],
                                                                                "node_type" : "In",
                                                                                "ref_id" : "395"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Interval["
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "( "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "HospitalizationInterval"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "QueryLetRef",
                                                                                                                "ref_id" : "389"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "390"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " - "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "1 hour"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Quantity",
                                                                                                        "ref_id" : "391"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "392"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " )"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "392"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ", "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "GlucoseTest1000Time"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "393"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Interval",
                                                                                "ref_id" : "394"
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "395"
                                                                    }
                                                                ],
                                                                "node_type" : "And",
                                                                "ref_id" : "396"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n      and "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EarlierGlucoseTest"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "397"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "id"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "398"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "398"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " !~ "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "GlucoseResult1000"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "399"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "id"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "400"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "400"
                                                                    }
                                                                ],
                                                                "node_type" : "Not",
                                                                "ref_id" : "401"
                                                            }
                                                        ],
                                                        "ref_id" : "402"
                                                    }
                                                ],
                                                "ref_id" : "402"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "GlucoseResult1000"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "AliasRef",
                                                        "ref_id" : "403"
                                                    }
                                                ],
                                                "ref_id" : "404"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "405"
                                    }
                                ],
                                "ref_id" : "406"
                            }
                        ],
                        "define_name" : "Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "349"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " GlucoseResult1000"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "350"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "where "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "not "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "( "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "GlucoseResult1000"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "351"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "id"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "352"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "352"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " in "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "\"Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "ExpressionRef",
                                                                                        "ref_id" : "407"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "id"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Query",
                                                                                        "ref_id" : "408"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Query",
                                                                                "ref_id" : "408"
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "409"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "409"
                                                            }
                                                        ],
                                                        "ref_id" : "410"
                                                    }
                                                ],
                                                "ref_id" : "410"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "411"
                                    }
                                ],
                                "ref_id" : "412"
                            }
                        ],
                        "define_name" : "Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Encounter with First Glucose Greater Than or Equal to 1000\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Initial Population\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "312"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " InpatientHospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "313"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "with "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "413"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " FirstGlucoseResult"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "414"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n      such that "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "FirstGlucoseResult"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "415"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "result"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "416"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "416"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " >= "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "1000 'mg/dL'"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Quantity",
                                                                        "ref_id" : "417"
                                                                    }
                                                                ],
                                                                "node_type" : "GreaterOrEqual",
                                                                "ref_id" : "418"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n        and "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Global"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "419"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"EarliestOf\" ( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "FirstGlucoseResult"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "420"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantDatetime"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "421"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "421"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ", "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "FirstGlucoseResult"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "422"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "423"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "423"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "FunctionRef",
                                                                                "ref_id" : "424"
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "424"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " during "
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "438"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Interval["
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "Global"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "425"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "\"HospitalizationWithObservation\" ( "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "InpatientHospitalization"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "AliasRef",
                                                                                                                        "ref_id" : "426"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : " )"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "FunctionRef",
                                                                                                                "ref_id" : "427"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "FunctionRef",
                                                                                                        "ref_id" : "427"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "428"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " - "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "1 hour"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Quantity",
                                                                                                "ref_id" : "429"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "430"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "430"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "( "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "Global"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "431"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "\"HospitalizationWithObservation\" ( "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "InpatientHospitalization"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "AliasRef",
                                                                                                                        "ref_id" : "432"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : " )"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "FunctionRef",
                                                                                                                "ref_id" : "433"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "FunctionRef",
                                                                                                        "ref_id" : "433"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "434"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " + "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "6 hours"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Quantity",
                                                                                                "ref_id" : "435"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "436"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " )"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "436"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Interval",
                                                                        "ref_id" : "437"
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "438"
                                                            }
                                                        ],
                                                        "node_type" : "And",
                                                        "ref_id" : "439"
                                                    }
                                                ],
                                                "ref_id" : "440"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "InpatientHospitalization"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "AliasRef",
                                                        "ref_id" : "441"
                                                    }
                                                ],
                                                "ref_id" : "442"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "443"
                                    }
                                ],
                                "ref_id" : "444"
                            }
                        ],
                        "define_name" : "Encounter with First Glucose Greater Than or Equal to 1000"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Denominator Exclusions\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter with First Glucose Greater Than or Equal to 1000\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "ExpressionRef",
                                        "ref_id" : "445"
                                    }
                                ],
                                "ref_id" : "446"
                            }
                        ],
                        "define_name" : "Denominator Exclusions"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Encounter with Hyperglycemic Events\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Days with Hyperglycemic Events\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "ExpressionRef",
                                                                "ref_id" : "447"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " HyperglycemicEventDays"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "448"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "where "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "exists "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "( "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "HyperglycemicEventDays.eligibleEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "449"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " EligibleEventDay"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "450"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n        "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "where "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EligibleEventDay"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "451"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "hasHyperglycemicEvent"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "452"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "452"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "452"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "453"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n    )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "453"
                                                            }
                                                        ],
                                                        "ref_id" : "454"
                                                    }
                                                ],
                                                "ref_id" : "454"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "return "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "HyperglycemicEventDays"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "455"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "456"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "456"
                                                    }
                                                ],
                                                "ref_id" : "457"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "458"
                                    }
                                ],
                                "ref_id" : "459"
                            }
                        ],
                        "define_name" : "Encounter with Hyperglycemic Events"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Numerator\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter with Hyperglycemic Events\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "ExpressionRef",
                                        "ref_id" : "460"
                                    }
                                ],
                                "ref_id" : "461"
                            }
                        ],
                        "define_name" : "Numerator"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"SDE Ethnicity\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "[\"Patient Characteristic Ethnicity\": "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"Ethnicity\""
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "]"
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "Retrieve",
                                        "ref_id" : "462"
                                    }
                                ],
                                "ref_id" : "463"
                            }
                        ],
                        "define_name" : "SDE Ethnicity"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"SDE Payer\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "[\"Patient Characteristic Payer\": "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"Payer\""
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "]"
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "Retrieve",
                                        "ref_id" : "464"
                                    }
                                ],
                                "ref_id" : "465"
                            }
                        ],
                        "define_name" : "SDE Payer"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"SDE Race\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "[\"Patient Characteristic Race\": "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"Race\""
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "]"
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "Retrieve",
                                        "ref_id" : "466"
                                    }
                                ],
                                "ref_id" : "467"
                            }
                        ],
                        "define_name" : "SDE Race"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"SDE Sex\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "[\"Patient Characteristic Sex\": "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"ONC Administrative Sex\""
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "]"
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "Retrieve",
                                        "ref_id" : "468"
                                    }
                                ],
                                "ref_id" : "469"
                            }
                        ],
                        "define_name" : "SDE Sex"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/**\n * Counts the number of eligible days in an encounter. This simply filters and counts the data built in\n * \"Days With Glucose Results\".*/define function \"Denominator Observations\"(QualifyingEncounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "479"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "if "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "QualifyingEncounter"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "480"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "id"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "481"
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "481"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " in "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Denominator Exclusions\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "ExpressionRef",
                                                                        "ref_id" : "482"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "id"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "483"
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "483"
                                                            }
                                                        ],
                                                        "ref_id" : "484"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " then "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "singleton from "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "( "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"Days with Hyperglycemic Events\""
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "ExpressionRef",
                                                                                                "ref_id" : "485"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " EncounterWithEventDays"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "486"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "where "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterWithEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "487"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "encounter"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "488"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "488"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " = "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "QualifyingEncounter"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "OperandRef",
                                                                                                "ref_id" : "489"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "490"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "490"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "return 0"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Literal",
                                                                                        "ref_id" : "491"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "492"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "493"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "493"
                                                            }
                                                        ],
                                                        "ref_id" : "494"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " \n    else "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "singleton from "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "( "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"Days with Hyperglycemic Events\""
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "ExpressionRef",
                                                                                                "ref_id" : "495"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " EncounterWithEventDays"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "496"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "where "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterWithEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "497"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "encounter"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "498"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "498"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " = "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "QualifyingEncounter"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "OperandRef",
                                                                                                "ref_id" : "499"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "500"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "500"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "return "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Count("
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterWithEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "501"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "eligibleEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "502"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "502"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : ")"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Count",
                                                                                        "ref_id" : "503"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "504"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "505"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "505"
                                                            }
                                                        ],
                                                        "ref_id" : "506"
                                                    }
                                                ],
                                                "node_type" : "If",
                                                "ref_id" : "507"
                                            }
                                        ],
                                        "node_type" : "If",
                                        "ref_id" : "507"
                                    }
                                ],
                                "ref_id" : "508"
                            }
                        ],
                        "define_name" : "Denominator Observations"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/**\n * Counts the number of eligible days with a hyperglycemic event in an encounter. This simply filters and counts the data built in\n * \"Days With Hyperglycemic Events\".*/define function \"Numerator Observations\"(QualifyingEncounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "509"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "if "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "QualifyingEncounter"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "510"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "id"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "511"
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "511"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " in "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Denominator Exclusions\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "ExpressionRef",
                                                                        "ref_id" : "512"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "."
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "id"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "513"
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "513"
                                                            }
                                                        ],
                                                        "ref_id" : "514"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " then "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "singleton from "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "( "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"Days with Hyperglycemic Events\""
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "ExpressionRef",
                                                                                                "ref_id" : "515"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " EncounterWithEventDays"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "516"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "where "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterWithEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "517"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "encounter"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "518"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "518"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " = "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "QualifyingEncounter"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "OperandRef",
                                                                                                "ref_id" : "519"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "520"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "520"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "return 0"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Literal",
                                                                                        "ref_id" : "521"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "522"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "523"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "523"
                                                            }
                                                        ],
                                                        "ref_id" : "524"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " \n    else "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "singleton from "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "( "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"Days with Hyperglycemic Events\""
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "ExpressionRef",
                                                                                                "ref_id" : "525"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " EncounterWithEventDays"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "526"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "where "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "EncounterWithEventDays"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "527"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "encounter"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "528"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "528"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " = "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "QualifyingEncounter"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "OperandRef",
                                                                                                "ref_id" : "529"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "530"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "530"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "return "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Count("
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "children" : [
                                                                                                                                            {
                                                                                                                                                "text" : "EncounterWithEventDays.eligibleEventDays"
                                                                                                                                            }
                                                                                                                                        ]
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Property",
                                                                                                                        "ref_id" : "531"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : " EligibleEventDay"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "532"
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "\n          "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "where "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "EligibleEventDay"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "533"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "hasHyperglycemicEvent"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "534"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "534"
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "534"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "535"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "\n      )"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Count",
                                                                                        "ref_id" : "536"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "537"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Query",
                                                                        "ref_id" : "538"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Query",
                                                                "ref_id" : "538"
                                                            }
                                                        ],
                                                        "ref_id" : "539"
                                                    }
                                                ],
                                                "node_type" : "If",
                                                "ref_id" : "540"
                                            }
                                        ],
                                        "node_type" : "If",
                                        "ref_id" : "540"
                                    }
                                ],
                                "ref_id" : "541"
                            }
                        ],
                        "define_name" : "Numerator Observations"
                    }
                ],
                "identifier" : {
                    "id" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "version" : "2.0.027"
                }
            },
            "is_main_library" : true,
            "statement_dependencies" : [
                {
                    "_id" : "64232952f9a010eeafc2a055",
                    "statement_name" : "Patient"
                },
                {
                    "_id" : "64232952f9a010eeafc2a056",
                    "statement_name" : "Qualifying Encounter",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a057",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Patient"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a058",
                    "statement_name" : "Encounter with Hospitalization Period",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a059",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Qualifying Encounter"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a05a",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "HospitalizationWithObservation"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a05b",
                    "statement_name" : "Encounter with Existing Diabetes Diagnosis",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a05c",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Hospitalization Period"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a05d",
                    "statement_name" : "Encounter with Hypoglycemic Medication",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a05e",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Hospitalization Period"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a05f",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "NormalizeInterval"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a060",
                    "statement_name" : "Encounter with Elevated Glucose Greater Than or Equal to 200",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a061",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Hospitalization Period"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a062",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "EarliestOf"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a063",
                    "statement_name" : "Initial Population",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a064",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Existing Diabetes Diagnosis"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a065",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Hypoglycemic Medication"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a066",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Elevated Glucose Greater Than or Equal to 200"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a067",
                    "statement_name" : "Denominator",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a068",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Initial Population"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a069",
                    "statement_name" : "Measurement Population",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a06a",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Denominator"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a06b",
                    "statement_name" : "Hospital Days Max 10"
                },
                {
                    "_id" : "64232952f9a010eeafc2a06c",
                    "statement_name" : "Interval To Day Numbers"
                },
                {
                    "_id" : "64232952f9a010eeafc2a06d",
                    "statement_name" : "Days In Period",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a06e",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Interval To Day Numbers"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a06f",
                    "statement_name" : "Days in Hospitalization",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a070",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Measurement Population"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a071",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "HospitalizationWithObservation"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a072",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Hospital Days Max 10"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a073",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Days In Period"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a074",
                    "statement_name" : "Days with Glucose Results",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a075",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Days in Hospitalization"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a076",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "EarliestOf"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a077",
                    "statement_name" : "Days with Hyperglycemic Events",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a078",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Days with Glucose Results"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a079",
                    "statement_name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a07a",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Initial Population"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a07b",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "HospitalizationWithObservation"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a07c",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "EarliestOf"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a07d",
                    "statement_name" : "Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a07e",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Initial Population"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a07f",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a080",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "HospitalizationWithObservation"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a081",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "EarliestOf"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a082",
                    "statement_name" : "Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a083",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a084",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Glucose Tests Earlier Than Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a085",
                    "statement_name" : "Encounter with First Glucose Greater Than or Equal to 1000",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a086",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Initial Population"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a087",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Initial Glucose Greater Than or Equal to 1000 within 1 Hour Prior To and 6 Hours After Encounter Start"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a088",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "EarliestOf"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a089",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "HospitalizationWithObservation"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a08a",
                    "statement_name" : "Denominator Exclusions",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a08b",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with First Glucose Greater Than or Equal to 1000"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a08c",
                    "statement_name" : "Encounter with Hyperglycemic Events",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a08d",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Days with Hyperglycemic Events"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a08e",
                    "statement_name" : "Numerator",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a08f",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Encounter with Hyperglycemic Events"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a090",
                    "statement_name" : "SDE Ethnicity"
                },
                {
                    "_id" : "64232952f9a010eeafc2a091",
                    "statement_name" : "SDE Payer"
                },
                {
                    "_id" : "64232952f9a010eeafc2a092",
                    "statement_name" : "SDE Race"
                },
                {
                    "_id" : "64232952f9a010eeafc2a093",
                    "statement_name" : "SDE Sex"
                },
                {
                    "_id" : "64232952f9a010eeafc2a094",
                    "statement_name" : "Denominator Observations",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a095",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Denominator Exclusions"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a096",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Days with Hyperglycemic Events"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a097",
                    "statement_name" : "Numerator Observations",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a098",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Denominator Exclusions"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a099",
                            "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                            "statement_name" : "Days with Hyperglycemic Events"
                        }
                    ]
                }
            ]
        },
        {
            "_id" : "64232952f9a010eeafc2a09a",
            "is_top_level" : true,
            "library_name" : "MATGlobalCommonFunctions",
            "library_version" : "7.0.000",
            "elm" : {
                "library" : {
                    "annotation" : [
                        {
                            "translatorOptions" : "EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion,DisableMethodInvocation",
                            "type" : "CqlToElmInfo"
                        },
                        {
                            "type" : "Annotation",
                            "s" : {
                                "r" : "404",
                                "s" : [
                                    {
                                        "value" : [
                                            "",
                                            "library MATGlobalCommonFunctions version '7.0.000'"
                                        ]
                                    }
                                ]
                            }
                        }
                    ],
                    "identifier" : {
                        "id" : "MATGlobalCommonFunctions",
                        "version" : "7.0.000"
                    },
                    "schemaIdentifier" : {
                        "id" : "urn:hl7-org:elm",
                        "version" : "r1"
                    },
                    "usings" : {
                        "def" : [
                            {
                                "localIdentifier" : "System",
                                "uri" : "urn:hl7-org:elm-types:r1"
                            },
                            {
                                "localId" : "1",
                                "locator" : "3:1-3:23",
                                "localIdentifier" : "QDM",
                                "uri" : "urn:healthit-gov:qdm:v5_6",
                                "version" : "5.6",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "1",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "using "
                                                    ]
                                                },
                                                {
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "QDM"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " version ",
                                                        "'5.6'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "parameters" : {
                        "def" : [
                            {
                                "localId" : "9",
                                "locator" : "11:1-11:49",
                                "name" : "Measurement Period",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "9",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "parameter ",
                                                        "\"Measurement Period\"",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "8",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "7",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "parameterTypeSpecifier" : {
                                    "localId" : "8",
                                    "locator" : "11:32-11:49",
                                    "type" : "IntervalTypeSpecifier",
                                    "pointType" : {
                                        "localId" : "7",
                                        "locator" : "11:41-11:48",
                                        "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                        "type" : "NamedTypeSpecifier"
                                    }
                                }
                            }
                        ]
                    },
                    "valueSets" : {
                        "def" : [
                            {
                                "localId" : "2",
                                "locator" : "5:1-5:82",
                                "name" : "Emergency Department Visit",
                                "id" : "2.16.840.1.113883.3.117.1.7.1.292",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "2",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Emergency Department Visit\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113883.3.117.1.7.1.292'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "3",
                                "locator" : "6:1-6:71",
                                "name" : "Encounter Inpatient",
                                "id" : "2.16.840.1.113883.3.666.5.307",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "3",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Encounter Inpatient\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113883.3.666.5.307'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "4",
                                "locator" : "7:1-7:72",
                                "name" : "Intensive Care Unit",
                                "id" : "2.16.840.1.113762.1.4.1029.206",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "4",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Intensive Care Unit\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113762.1.4.1029.206'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "5",
                                "locator" : "8:1-8:73",
                                "name" : "Observation Services",
                                "id" : "2.16.840.1.113762.1.4.1111.143",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "5",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Observation Services\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113762.1.4.1111.143'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "6",
                                "locator" : "9:1-9:78",
                                "name" : "Outpatient Surgery Service",
                                "id" : "2.16.840.1.113762.1.4.1110.38",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "6",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "valueset ",
                                                        "\"Outpatient Surgery Service\"",
                                                        ": ",
                                                        "'urn:oid:2.16.840.1.113762.1.4.1110.38'"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "contexts" : {
                        "def" : [
                            {
                                "locator" : "13:1-13:15",
                                "name" : "Patient"
                            }
                        ]
                    },
                    "statements" : {
                        "def" : [
                            {
                                "locator" : "13:1-13:15",
                                "name" : "Patient",
                                "context" : "Patient",
                                "expression" : {
                                    "type" : "SingletonFrom",
                                    "operand" : {
                                        "locator" : "13:1-13:15",
                                        "dataType" : "{urn:healthit-gov:qdm:v5_6}Patient",
                                        "templateId" : "Patient",
                                        "type" : "Retrieve"
                                    }
                                }
                            },
                            {
                                "localId" : "11",
                                "locator" : "15:1-16:56",
                                "name" : "ED Encounter",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "11",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"ED Encounter\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "10",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "[",
                                                                "\"Encounter, Performed\"",
                                                                ": "
                                                            ]
                                                        },
                                                        {
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"Emergency Department Visit\""
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "]"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "10",
                                    "locator" : "16:3-16:56",
                                    "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                    "templateId" : "PositiveEncounterPerformed",
                                    "codeProperty" : "code",
                                    "codeComparator" : "in",
                                    "type" : "Retrieve",
                                    "codes" : {
                                        "locator" : "16:28-16:55",
                                        "name" : "Emergency Department Visit",
                                        "type" : "ValueSetRef"
                                    }
                                }
                            },
                            {
                                "localId" : "23",
                                "locator" : "32:1-33:60",
                                "name" : "LengthInDays",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "23",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*calculates the difference in calendar days between the start and end of the given interval.*/",
                                                        "define function ",
                                                        "\"LengthInDays\"",
                                                        "(",
                                                        "Value",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "17",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "16",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "22",
                                                    "s" : [
                                                        {
                                                            "r" : "22",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "difference in days between "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "19",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "start of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "18",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Value"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " and "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "21",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "end of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "20",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Value"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "22",
                                    "locator" : "33:3-33:60",
                                    "precision" : "Day",
                                    "type" : "DifferenceBetween",
                                    "operand" : [
                                        {
                                            "localId" : "19",
                                            "locator" : "33:30-33:43",
                                            "type" : "Start",
                                            "operand" : {
                                                "localId" : "18",
                                                "locator" : "33:39-33:43",
                                                "name" : "Value",
                                                "type" : "OperandRef"
                                            }
                                        },
                                        {
                                            "localId" : "21",
                                            "locator" : "33:49-33:60",
                                            "type" : "End",
                                            "operand" : {
                                                "localId" : "20",
                                                "locator" : "33:56-33:60",
                                                "name" : "Value",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    ]
                                },
                                "operand" : [
                                    {
                                        "name" : "Value",
                                        "operandTypeSpecifier" : {
                                            "localId" : "17",
                                            "locator" : "32:38-32:55",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "16",
                                                "locator" : "32:47-32:54",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "33",
                                "locator" : "18:1-21:83",
                                "name" : "Inpatient Encounter",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "33",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "",
                                                        "define ",
                                                        "\"Inpatient Encounter\"",
                                                        ":\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "32",
                                                    "s" : [
                                                        {
                                                            "s" : [
                                                                {
                                                                    "r" : "13",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "12",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "12",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "[",
                                                                                                "\"Encounter, Performed\"",
                                                                                                ": "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\"Encounter Inpatient\""
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "]"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " ",
                                                                                "EncounterInpatient"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                "\n    "
                                                            ]
                                                        },
                                                        {
                                                            "r" : "31",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "where "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "31",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "26",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "24",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"LengthInDays\"",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "15",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "14",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "EncounterInpatient"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "15",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "25",
                                                                                    "value" : [
                                                                                        "<=",
                                                                                        " ",
                                                                                        "120"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n      and "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "30",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "28",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "27",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EncounterInpatient"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "28",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "relevantPeriod"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "30",
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "ends during day of",
                                                                                        " "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "29",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "\"Measurement Period\""
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "32",
                                    "locator" : "19:3-21:83",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "13",
                                            "locator" : "19:3-19:68",
                                            "alias" : "EncounterInpatient",
                                            "expression" : {
                                                "localId" : "12",
                                                "locator" : "19:3-19:49",
                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                "templateId" : "PositiveEncounterPerformed",
                                                "codeProperty" : "code",
                                                "codeComparator" : "in",
                                                "type" : "Retrieve",
                                                "codes" : {
                                                    "locator" : "19:28-19:48",
                                                    "name" : "Encounter Inpatient",
                                                    "type" : "ValueSetRef"
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "where" : {
                                        "localId" : "31",
                                        "locator" : "20:5-21:83",
                                        "type" : "And",
                                        "operand" : [
                                            {
                                                "localId" : "26",
                                                "locator" : "20:11-20:65",
                                                "type" : "LessOrEqual",
                                                "operand" : [
                                                    {
                                                        "localId" : "24",
                                                        "locator" : "20:11-20:59",
                                                        "name" : "LengthInDays",
                                                        "type" : "FunctionRef",
                                                        "operand" : [
                                                            {
                                                                "localId" : "15",
                                                                "locator" : "20:26-20:58",
                                                                "path" : "relevantPeriod",
                                                                "scope" : "EncounterInpatient",
                                                                "type" : "Property"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "localId" : "25",
                                                        "locator" : "20:63-20:65",
                                                        "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                                                        "value" : "120",
                                                        "type" : "Literal"
                                                    }
                                                ]
                                            },
                                            {
                                                "localId" : "30",
                                                "locator" : "21:11-21:83",
                                                "precision" : "Day",
                                                "type" : "In",
                                                "operand" : [
                                                    {
                                                        "locator" : "21:45-21:48",
                                                        "type" : "End",
                                                        "operand" : {
                                                            "localId" : "28",
                                                            "locator" : "21:11-21:43",
                                                            "path" : "relevantPeriod",
                                                            "scope" : "EncounterInpatient",
                                                            "type" : "Property"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "29",
                                                        "locator" : "21:64-21:83",
                                                        "name" : "Measurement Period",
                                                        "type" : "ParameterRef"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            },
                            {
                                "localId" : "43",
                                "locator" : "28:1-29:62",
                                "name" : "ToDateInterval",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "t" : [
                                            {
                                                "name" : "description",
                                                "value" : "Returns an interval of date values extracted from the input interval of date-time values"
                                            },
                                            {
                                                "name" : "description",
                                                "value" : "Returns an interval of date values extracted from the input interval of date-time values"
                                            },
                                            {
                                                "name" : "comment",
                                                "value" : "This function returns an interval constructed using the `date from` extractor on the start\nand end values of the input date-time interval. Note that using a precision specifier as part of a\ntiming phrase is preferred to communicate intent to perform day-level comparison, as well as for\ngeneral readability."
                                            }
                                        ],
                                        "s" : {
                                            "r" : "43",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*@description: Returns an interval of date values extracted from the input interval of date-time values\n@comment: This function returns an interval constructed using the `date from` extractor on the start\nand end values of the input date-time interval. Note that using a precision specifier as part of a\ntiming phrase is preferred to communicate intent to perform day-level comparison, as well as for\ngeneral readability.*/",
                                                        "define function ",
                                                        "\"ToDateInterval\"",
                                                        "(",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "35",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "34",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "42",
                                                    "s" : [
                                                        {
                                                            "r" : "42",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "Interval["
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "38",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "date from "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "37",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "start of "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "36",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ", "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "41",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "date from "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "40",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "end of "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "39",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "]"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "42",
                                    "locator" : "29:3-29:62",
                                    "lowClosed" : true,
                                    "highClosed" : true,
                                    "type" : "Interval",
                                    "low" : {
                                        "localId" : "38",
                                        "locator" : "29:12-29:36",
                                        "type" : "DateFrom",
                                        "operand" : {
                                            "localId" : "37",
                                            "locator" : "29:22-29:36",
                                            "type" : "Start",
                                            "operand" : {
                                                "localId" : "36",
                                                "locator" : "29:31-29:36",
                                                "name" : "period",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    },
                                    "high" : {
                                        "localId" : "41",
                                        "locator" : "29:39-29:61",
                                        "type" : "DateFrom",
                                        "operand" : {
                                            "localId" : "40",
                                            "locator" : "29:49-29:61",
                                            "type" : "End",
                                            "operand" : {
                                                "localId" : "39",
                                                "locator" : "29:56-29:61",
                                                "name" : "period",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "35",
                                            "locator" : "28:41-28:58",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "34",
                                                "locator" : "28:50-28:57",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "79",
                                "locator" : "36:1-44:71",
                                "name" : "HospitalizationLocations",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "79",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*returns list of all locations within an encounter, including locations for immediately prior ED visit.*/",
                                                        "define function ",
                                                        "\"HospitalizationLocations\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "47",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "78",
                                                    "s" : [
                                                        {
                                                            "r" : "78",
                                                            "s" : [
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "r" : "49",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "48",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Encounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "Visit"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "let "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "65",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "EDVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "64",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "63",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "51",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "50",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "50",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Emergency Department Visit\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastED"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "58",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "58",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "53",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "52",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastED"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "53",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "58",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "57",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "56",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "55",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "54",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "Visit"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "55",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "relevantPeriod"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "62",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "61",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "60",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "59",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "77",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "return "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "76",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "if "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "67",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "66",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "EDVisit"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " is null"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " then "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "69",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "68",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Visit"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "."
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "69",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "facilityLocations"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " \n  \t\telse "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "75",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "flatten "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "74",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "{ "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "71",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "70",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EDVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "71",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "facilityLocations"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ", "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "73",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "72",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Visit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "73",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "facilityLocations"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " }"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "78",
                                    "locator" : "37:3-44:71",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "49",
                                            "locator" : "37:3-37:17",
                                            "alias" : "Visit",
                                            "expression" : {
                                                "localId" : "48",
                                                "locator" : "37:3-37:11",
                                                "name" : "Encounter",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "65",
                                            "locator" : "38:8-42:4",
                                            "identifier" : "EDVisit",
                                            "expression" : {
                                                "localId" : "64",
                                                "locator" : "38:17-42:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "63",
                                                    "locator" : "38:22-41:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "51",
                                                            "locator" : "38:22-38:82",
                                                            "alias" : "LastED",
                                                            "expression" : {
                                                                "localId" : "50",
                                                                "locator" : "38:22-38:75",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "38:47-38:74",
                                                                    "name" : "Emergency Department Visit",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "58",
                                                        "locator" : "39:6-39:95",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "39:39-39:52",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "39:34-39:37",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "53",
                                                                            "locator" : "39:12-39:32",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastED",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "39:39-39:52",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "39:67-39:95",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "56",
                                                                                    "locator" : "39:67-39:95",
                                                                                    "type" : "Start",
                                                                                    "operand" : {
                                                                                        "localId" : "55",
                                                                                        "locator" : "39:76-39:95",
                                                                                        "path" : "relevantPeriod",
                                                                                        "scope" : "Visit",
                                                                                        "type" : "Property"
                                                                                    }
                                                                                },
                                                                                {
                                                                                    "localId" : "57",
                                                                                    "locator" : "39:39-39:44",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "56",
                                                                            "locator" : "39:67-39:95",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "55",
                                                                                "locator" : "39:76-39:95",
                                                                                "path" : "relevantPeriod",
                                                                                "scope" : "Visit",
                                                                                "type" : "Property"
                                                                            }
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "39:39-39:52",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "39:39-39:52",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "56",
                                                                        "locator" : "39:67-39:95",
                                                                        "type" : "Start",
                                                                        "operand" : {
                                                                            "localId" : "55",
                                                                            "locator" : "39:76-39:95",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "Visit",
                                                                            "type" : "Property"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "62",
                                                        "locator" : "40:6-41:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "61",
                                                                "locator" : "41:6-41:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "60",
                                                                    "locator" : "41:6-41:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "59",
                                                                        "locator" : "41:13-41:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "77",
                                        "locator" : "43:4-44:71",
                                        "expression" : {
                                            "localId" : "76",
                                            "locator" : "43:11-44:71",
                                            "type" : "If",
                                            "condition" : {
                                                "localId" : "67",
                                                "locator" : "43:14-43:28",
                                                "type" : "IsNull",
                                                "operand" : {
                                                    "localId" : "66",
                                                    "locator" : "43:14-43:20",
                                                    "name" : "EDVisit",
                                                    "type" : "QueryLetRef"
                                                }
                                            },
                                            "then" : {
                                                "localId" : "69",
                                                "locator" : "43:35-43:57",
                                                "path" : "facilityLocations",
                                                "scope" : "Visit",
                                                "type" : "Property"
                                            },
                                            "else" : {
                                                "localId" : "75",
                                                "locator" : "44:10-44:71",
                                                "type" : "Flatten",
                                                "operand" : {
                                                    "localId" : "74",
                                                    "locator" : "44:18-44:71",
                                                    "type" : "List",
                                                    "element" : [
                                                        {
                                                            "localId" : "71",
                                                            "locator" : "44:20-44:44",
                                                            "path" : "facilityLocations",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "70",
                                                                "locator" : "44:20-44:26",
                                                                "name" : "EDVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        },
                                                        {
                                                            "localId" : "73",
                                                            "locator" : "44:47-44:69",
                                                            "path" : "facilityLocations",
                                                            "scope" : "Visit",
                                                            "type" : "Property"
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "47",
                                            "locator" : "36:54-36:75",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "96",
                                "locator" : "47:1-51:18",
                                "name" : "EmergencyDepartmentArrivalTime",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "96",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Returns the arrival time in the ED for the encounter.*/",
                                                        "define function ",
                                                        "\"EmergencyDepartmentArrivalTime\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "80",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "95",
                                                    "s" : [
                                                        {
                                                            "r" : "95",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "start of "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "94",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "93",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "First",
                                                                                        "("
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "92",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "83",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "82",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "("
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "82",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"HospitalizationLocations\"",
                                                                                                                                "("
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "81",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "Encounter"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                ")"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ")"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "HospitalLocation"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t\t"
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "87",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "where "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "87",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "85",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "84",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "HospitalLocation"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "."
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "85",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "code"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                " in "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "86",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "\"Emergency Department Visit\""
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t\t"
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "91",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "sort by "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "90",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "89",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "88",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "locationPeriod"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "94",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "locationPeriod"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "95",
                                    "locator" : "48:3-51:18",
                                    "type" : "Start",
                                    "operand" : {
                                        "localId" : "94",
                                        "locator" : "48:12-51:18",
                                        "path" : "locationPeriod",
                                        "type" : "Property",
                                        "source" : {
                                            "localId" : "93",
                                            "locator" : "48:12-51:3",
                                            "type" : "First",
                                            "source" : {
                                                "localId" : "92",
                                                "locator" : "48:18-50:35",
                                                "type" : "Query",
                                                "source" : [
                                                    {
                                                        "localId" : "83",
                                                        "locator" : "48:18-48:72",
                                                        "alias" : "HospitalLocation",
                                                        "expression" : {
                                                            "localId" : "82",
                                                            "locator" : "48:18-48:56",
                                                            "name" : "HospitalizationLocations",
                                                            "type" : "FunctionRef",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "81",
                                                                    "locator" : "48:46-48:54",
                                                                    "name" : "Encounter",
                                                                    "type" : "OperandRef"
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ],
                                                "relationship" : [

                                                ],
                                                "where" : {
                                                    "localId" : "87",
                                                    "locator" : "49:5-49:63",
                                                    "type" : "InValueSet",
                                                    "code" : {
                                                        "localId" : "85",
                                                        "locator" : "49:11-49:31",
                                                        "path" : "code",
                                                        "scope" : "HospitalLocation",
                                                        "type" : "Property"
                                                    },
                                                    "valueset" : {
                                                        "localId" : "86",
                                                        "locator" : "49:36-49:63",
                                                        "name" : "Emergency Department Visit",
                                                        "type" : "ValueSetRef"
                                                    }
                                                },
                                                "sort" : {
                                                    "localId" : "91",
                                                    "locator" : "50:5-50:35",
                                                    "by" : [
                                                        {
                                                            "localId" : "90",
                                                            "locator" : "50:13-50:35",
                                                            "direction" : "asc",
                                                            "type" : "ByExpression",
                                                            "expression" : {
                                                                "localId" : "89",
                                                                "locator" : "50:13-50:35",
                                                                "type" : "Start",
                                                                "operand" : {
                                                                    "localId" : "88",
                                                                    "locator" : "50:22-50:35",
                                                                    "name" : "locationPeriod",
                                                                    "type" : "IdentifierRef"
                                                                }
                                                            }
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "80",
                                            "locator" : "47:60-47:81",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "131",
                                "locator" : "64:1-72:31",
                                "name" : "Hospitalization",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "131",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.*/",
                                                        "define function ",
                                                        "\"Hospitalization\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "99",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "130",
                                                    "s" : [
                                                        {
                                                            "r" : "130",
                                                            "s" : [
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "r" : "101",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "100",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Encounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "Visit"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "let "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "117",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "EDVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "116",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "115",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "103",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "102",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "102",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Emergency Department Visit\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastED"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "110",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "110",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "105",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "104",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastED"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "105",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "110",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "109",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "108",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "107",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "106",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "Visit"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "107",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "relevantPeriod"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "114",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "113",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "112",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "111",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "129",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "return "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "128",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Interval["
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "124",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Coalesce",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "120",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "119",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "118",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EDVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "119",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "123",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "122",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "121",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Visit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "122",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ", \n  \t"
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "127",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "end of "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "126",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "125",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Visit"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "126",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "]"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "130",
                                    "locator" : "65:3-72:31",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "101",
                                            "locator" : "65:3-65:17",
                                            "alias" : "Visit",
                                            "expression" : {
                                                "localId" : "100",
                                                "locator" : "65:3-65:11",
                                                "name" : "Encounter",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "117",
                                            "locator" : "66:8-70:4",
                                            "identifier" : "EDVisit",
                                            "expression" : {
                                                "localId" : "116",
                                                "locator" : "66:17-70:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "115",
                                                    "locator" : "66:22-69:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "103",
                                                            "locator" : "66:22-66:82",
                                                            "alias" : "LastED",
                                                            "expression" : {
                                                                "localId" : "102",
                                                                "locator" : "66:22-66:75",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "66:47-66:74",
                                                                    "name" : "Emergency Department Visit",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "110",
                                                        "locator" : "67:6-67:95",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "67:39-67:52",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "67:34-67:37",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "105",
                                                                            "locator" : "67:12-67:32",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastED",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "67:39-67:52",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "67:67-67:95",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "108",
                                                                                    "locator" : "67:67-67:95",
                                                                                    "type" : "Start",
                                                                                    "operand" : {
                                                                                        "localId" : "107",
                                                                                        "locator" : "67:76-67:95",
                                                                                        "path" : "relevantPeriod",
                                                                                        "scope" : "Visit",
                                                                                        "type" : "Property"
                                                                                    }
                                                                                },
                                                                                {
                                                                                    "localId" : "109",
                                                                                    "locator" : "67:39-67:44",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "108",
                                                                            "locator" : "67:67-67:95",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "107",
                                                                                "locator" : "67:76-67:95",
                                                                                "path" : "relevantPeriod",
                                                                                "scope" : "Visit",
                                                                                "type" : "Property"
                                                                            }
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "67:39-67:52",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "67:39-67:52",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "108",
                                                                        "locator" : "67:67-67:95",
                                                                        "type" : "Start",
                                                                        "operand" : {
                                                                            "localId" : "107",
                                                                            "locator" : "67:76-67:95",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "Visit",
                                                                            "type" : "Property"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "114",
                                                        "locator" : "68:6-69:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "113",
                                                                "locator" : "69:6-69:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "112",
                                                                    "locator" : "69:6-69:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "111",
                                                                        "locator" : "69:13-69:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "129",
                                        "locator" : "71:4-72:31",
                                        "expression" : {
                                            "localId" : "128",
                                            "locator" : "71:11-72:31",
                                            "lowClosed" : true,
                                            "highClosed" : true,
                                            "type" : "Interval",
                                            "low" : {
                                                "localId" : "124",
                                                "locator" : "71:20-71:91",
                                                "type" : "Coalesce",
                                                "operand" : [
                                                    {
                                                        "localId" : "120",
                                                        "locator" : "71:29-71:59",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "119",
                                                            "locator" : "71:38-71:59",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "118",
                                                                "locator" : "71:38-71:44",
                                                                "name" : "EDVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "localId" : "123",
                                                        "locator" : "71:62-71:90",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "122",
                                                            "locator" : "71:71-71:90",
                                                            "path" : "relevantPeriod",
                                                            "scope" : "Visit",
                                                            "type" : "Property"
                                                        }
                                                    }
                                                ]
                                            },
                                            "high" : {
                                                "localId" : "127",
                                                "locator" : "72:4-72:30",
                                                "type" : "End",
                                                "operand" : {
                                                    "localId" : "126",
                                                    "locator" : "72:11-72:30",
                                                    "path" : "relevantPeriod",
                                                    "scope" : "Visit",
                                                    "type" : "Property"
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "99",
                                            "locator" : "64:45-64:66",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "134",
                                "locator" : "54:1-55:39",
                                "name" : "HospitalAdmissionTime",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "134",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Returns admission time for an encounter or for immediately prior emergency department visit.*/",
                                                        "define function ",
                                                        "\"HospitalAdmissionTime\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "97",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "133",
                                                    "s" : [
                                                        {
                                                            "r" : "133",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "start of "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "132",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "\"Hospitalization\"",
                                                                                "("
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "98",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "133",
                                    "locator" : "55:3-55:39",
                                    "type" : "Start",
                                    "operand" : {
                                        "localId" : "132",
                                        "locator" : "55:12-55:39",
                                        "name" : "Hospitalization",
                                        "type" : "FunctionRef",
                                        "operand" : [
                                            {
                                                "localId" : "98",
                                                "locator" : "55:30-55:38",
                                                "name" : "Encounter",
                                                "type" : "OperandRef"
                                            }
                                        ]
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "97",
                                            "locator" : "54:51-54:72",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "147",
                                "locator" : "58:1-61:18",
                                "name" : "HospitalArrivalTime",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "147",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Returns earliest arrival time for an encounter including any prior ED visit.*/",
                                                        "define function ",
                                                        "\"HospitalArrivalTime\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "135",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "146",
                                                    "s" : [
                                                        {
                                                            "r" : "146",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "start of "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "145",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "144",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "First",
                                                                                        "("
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "143",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "138",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "137",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "("
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "137",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"HospitalizationLocations\"",
                                                                                                                                "("
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "136",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "Encounter"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                ")"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ")"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "HospitalLocation"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t\t"
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "142",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "sort by "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "141",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "140",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "139",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "locationPeriod"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "145",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "locationPeriod"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "146",
                                    "locator" : "59:3-61:18",
                                    "type" : "Start",
                                    "operand" : {
                                        "localId" : "145",
                                        "locator" : "59:12-61:18",
                                        "path" : "locationPeriod",
                                        "type" : "Property",
                                        "source" : {
                                            "localId" : "144",
                                            "locator" : "59:12-61:3",
                                            "type" : "First",
                                            "source" : {
                                                "localId" : "143",
                                                "locator" : "59:18-60:35",
                                                "type" : "Query",
                                                "source" : [
                                                    {
                                                        "localId" : "138",
                                                        "locator" : "59:18-59:72",
                                                        "alias" : "HospitalLocation",
                                                        "expression" : {
                                                            "localId" : "137",
                                                            "locator" : "59:18-59:56",
                                                            "name" : "HospitalizationLocations",
                                                            "type" : "FunctionRef",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "136",
                                                                    "locator" : "59:46-59:54",
                                                                    "name" : "Encounter",
                                                                    "type" : "OperandRef"
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ],
                                                "relationship" : [

                                                ],
                                                "sort" : {
                                                    "localId" : "142",
                                                    "locator" : "60:5-60:35",
                                                    "by" : [
                                                        {
                                                            "localId" : "141",
                                                            "locator" : "60:13-60:35",
                                                            "direction" : "asc",
                                                            "type" : "ByExpression",
                                                            "expression" : {
                                                                "localId" : "140",
                                                                "locator" : "60:13-60:35",
                                                                "type" : "Start",
                                                                "operand" : {
                                                                    "localId" : "139",
                                                                    "locator" : "60:22-60:35",
                                                                    "name" : "locationPeriod",
                                                                    "type" : "IdentifierRef"
                                                                }
                                                            }
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "135",
                                            "locator" : "58:49-58:70",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "154",
                                "locator" : "75:1-76:44",
                                "name" : "HospitalizationLengthofStay",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "154",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter*/",
                                                        "define function ",
                                                        "\"HospitalizationLengthofStay\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "150",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "153",
                                                    "s" : [
                                                        {
                                                            "r" : "153",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "LengthInDays",
                                                                        "("
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "152",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "\"Hospitalization\"",
                                                                                "("
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "151",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ")"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "153",
                                    "locator" : "76:3-76:44",
                                    "name" : "LengthInDays",
                                    "type" : "FunctionRef",
                                    "operand" : [
                                        {
                                            "localId" : "152",
                                            "locator" : "76:16-76:43",
                                            "name" : "Hospitalization",
                                            "type" : "FunctionRef",
                                            "operand" : [
                                                {
                                                    "localId" : "151",
                                                    "locator" : "76:34-76:42",
                                                    "name" : "Encounter",
                                                    "type" : "OperandRef"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "150",
                                            "locator" : "75:57-75:78",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "167",
                                "locator" : "79:1-82:18",
                                "name" : "HospitalDepartureTime",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "167",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Returns the latest departure time for encounter including any prior ED visit.*/",
                                                        "define function ",
                                                        "\"HospitalDepartureTime\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "155",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "166",
                                                    "s" : [
                                                        {
                                                            "r" : "166",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "end of "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "165",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "164",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Last",
                                                                                        "("
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "163",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "158",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "157",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "("
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "157",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "\"HospitalizationLocations\"",
                                                                                                                                "("
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "156",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "Encounter"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                ")"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        ")"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "HospitalLocation"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t\t"
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "162",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "sort by "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "161",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "160",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "start of "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "159",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "locationPeriod"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n  )"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "165",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "locationPeriod"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "166",
                                    "locator" : "80:3-82:18",
                                    "type" : "End",
                                    "operand" : {
                                        "localId" : "165",
                                        "locator" : "80:10-82:18",
                                        "path" : "locationPeriod",
                                        "type" : "Property",
                                        "source" : {
                                            "localId" : "164",
                                            "locator" : "80:10-82:3",
                                            "type" : "Last",
                                            "source" : {
                                                "localId" : "163",
                                                "locator" : "80:15-81:35",
                                                "type" : "Query",
                                                "source" : [
                                                    {
                                                        "localId" : "158",
                                                        "locator" : "80:15-80:69",
                                                        "alias" : "HospitalLocation",
                                                        "expression" : {
                                                            "localId" : "157",
                                                            "locator" : "80:15-80:53",
                                                            "name" : "HospitalizationLocations",
                                                            "type" : "FunctionRef",
                                                            "operand" : [
                                                                {
                                                                    "localId" : "156",
                                                                    "locator" : "80:43-80:51",
                                                                    "name" : "Encounter",
                                                                    "type" : "OperandRef"
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ],
                                                "relationship" : [

                                                ],
                                                "sort" : {
                                                    "localId" : "162",
                                                    "locator" : "81:5-81:35",
                                                    "by" : [
                                                        {
                                                            "localId" : "161",
                                                            "locator" : "81:13-81:35",
                                                            "direction" : "asc",
                                                            "type" : "ByExpression",
                                                            "expression" : {
                                                                "localId" : "160",
                                                                "locator" : "81:13-81:35",
                                                                "type" : "Start",
                                                                "operand" : {
                                                                    "localId" : "159",
                                                                    "locator" : "81:22-81:35",
                                                                    "name" : "locationPeriod",
                                                                    "type" : "IdentifierRef"
                                                                }
                                                            }
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "155",
                                            "locator" : "79:51-79:72",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "172",
                                "locator" : "85:1-86:33",
                                "name" : "HospitalDischargeTime",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "172",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Hospital Discharge Time returns the discharge time for an encounter*/",
                                                        "define function ",
                                                        "\"HospitalDischargeTime\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "168",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "171",
                                                    "s" : [
                                                        {
                                                            "r" : "171",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "end of "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "170",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "169",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "."
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "170",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "relevantPeriod"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "171",
                                    "locator" : "86:3-86:33",
                                    "type" : "End",
                                    "operand" : {
                                        "localId" : "170",
                                        "locator" : "86:10-86:33",
                                        "path" : "relevantPeriod",
                                        "type" : "Property",
                                        "source" : {
                                            "localId" : "169",
                                            "locator" : "86:10-86:18",
                                            "name" : "Encounter",
                                            "type" : "OperandRef"
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "168",
                                            "locator" : "85:51-85:72",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "245",
                                "locator" : "89:1-109:31",
                                "name" : "HospitalizationWithObservationAndOutpatientSurgeryService",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "245",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.*/",
                                                        "define function ",
                                                        "\"HospitalizationWithObservationAndOutpatientSurgeryService\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "173",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "244",
                                                    "s" : [
                                                        {
                                                            "r" : "244",
                                                            "s" : [
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "r" : "175",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "174",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Encounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "Visit"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "let "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "191",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "ObsVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "190",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "189",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "177",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "176",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "176",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Observation Services\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastObs"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "184",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "184",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "179",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "178",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastObs"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "179",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "184",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "183",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "182",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "181",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "180",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "Visit"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "181",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "relevantPeriod"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "188",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "187",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "186",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "185",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n  \t"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "199",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "VisitStart",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "198",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Coalesce",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "194",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "193",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "192",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "ObsVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "193",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "197",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "196",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "195",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Visit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "196",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n  \t"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "213",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "EDVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "212",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "211",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "201",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "200",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "200",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Emergency Department Visit\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastED"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "206",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "206",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "203",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "202",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastED"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "203",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "206",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "205",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "204",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "VisitStart"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "210",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "209",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "208",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "207",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n  \t"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "219",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "VisitStartWithED",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "218",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Coalesce",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "216",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "215",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "214",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EDVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "215",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "217",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "VisitStart"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n  \t"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "233",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "OutpatientSurgeryVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "232",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "231",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "221",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "220",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "220",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Outpatient Surgery Service\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastSurgeryOP"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "226",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "226",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "223",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "222",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastSurgeryOP"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "223",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "226",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "225",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "224",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "VisitStartWithED"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "230",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "229",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "228",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "227",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "243",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "return "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "242",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Interval["
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "238",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Coalesce",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "236",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "235",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "234",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "OutpatientSurgeryVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "235",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "237",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "VisitStartWithED"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ", \n  \t"
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "241",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "end of "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "240",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "239",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Visit"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "240",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "]"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "244",
                                    "locator" : "90:3-109:31",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "175",
                                            "locator" : "90:3-90:17",
                                            "alias" : "Visit",
                                            "expression" : {
                                                "localId" : "174",
                                                "locator" : "90:3-90:11",
                                                "name" : "Encounter",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "191",
                                            "locator" : "91:8-95:4",
                                            "identifier" : "ObsVisit",
                                            "expression" : {
                                                "localId" : "190",
                                                "locator" : "91:18-95:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "189",
                                                    "locator" : "91:23-94:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "177",
                                                            "locator" : "91:23-91:78",
                                                            "alias" : "LastObs",
                                                            "expression" : {
                                                                "localId" : "176",
                                                                "locator" : "91:23-91:70",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "91:48-91:69",
                                                                    "name" : "Observation Services",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "184",
                                                        "locator" : "92:6-92:96",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "92:40-92:53",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "92:35-92:38",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "179",
                                                                            "locator" : "92:12-92:33",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastObs",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "92:40-92:53",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "92:68-92:96",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "182",
                                                                                    "locator" : "92:68-92:96",
                                                                                    "type" : "Start",
                                                                                    "operand" : {
                                                                                        "localId" : "181",
                                                                                        "locator" : "92:77-92:96",
                                                                                        "path" : "relevantPeriod",
                                                                                        "scope" : "Visit",
                                                                                        "type" : "Property"
                                                                                    }
                                                                                },
                                                                                {
                                                                                    "localId" : "183",
                                                                                    "locator" : "92:40-92:45",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "182",
                                                                            "locator" : "92:68-92:96",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "181",
                                                                                "locator" : "92:77-92:96",
                                                                                "path" : "relevantPeriod",
                                                                                "scope" : "Visit",
                                                                                "type" : "Property"
                                                                            }
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "92:40-92:53",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "92:40-92:53",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "182",
                                                                        "locator" : "92:68-92:96",
                                                                        "type" : "Start",
                                                                        "operand" : {
                                                                            "localId" : "181",
                                                                            "locator" : "92:77-92:96",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "Visit",
                                                                            "type" : "Property"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "188",
                                                        "locator" : "93:6-94:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "187",
                                                                "locator" : "94:6-94:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "186",
                                                                    "locator" : "94:6-94:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "185",
                                                                        "locator" : "94:13-94:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        {
                                            "localId" : "199",
                                            "locator" : "96:4-96:88",
                                            "identifier" : "VisitStart",
                                            "expression" : {
                                                "localId" : "198",
                                                "locator" : "96:16-96:88",
                                                "type" : "Coalesce",
                                                "operand" : [
                                                    {
                                                        "localId" : "194",
                                                        "locator" : "96:25-96:56",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "193",
                                                            "locator" : "96:34-96:56",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "192",
                                                                "locator" : "96:34-96:41",
                                                                "name" : "ObsVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "localId" : "197",
                                                        "locator" : "96:59-96:87",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "196",
                                                            "locator" : "96:68-96:87",
                                                            "path" : "relevantPeriod",
                                                            "scope" : "Visit",
                                                            "type" : "Property"
                                                        }
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "213",
                                            "locator" : "97:4-101:4",
                                            "identifier" : "EDVisit",
                                            "expression" : {
                                                "localId" : "212",
                                                "locator" : "97:13-101:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "211",
                                                    "locator" : "97:18-100:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "201",
                                                            "locator" : "97:18-97:78",
                                                            "alias" : "LastED",
                                                            "expression" : {
                                                                "localId" : "200",
                                                                "locator" : "97:18-97:71",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "97:43-97:70",
                                                                    "name" : "Emergency Department Visit",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "206",
                                                        "locator" : "98:6-98:76",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "98:39-98:52",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "98:34-98:37",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "203",
                                                                            "locator" : "98:12-98:32",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastED",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "98:39-98:52",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "98:67-98:76",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "204",
                                                                                    "locator" : "98:67-98:76",
                                                                                    "name" : "VisitStart",
                                                                                    "type" : "QueryLetRef"
                                                                                },
                                                                                {
                                                                                    "localId" : "205",
                                                                                    "locator" : "98:39-98:44",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "204",
                                                                            "locator" : "98:67-98:76",
                                                                            "name" : "VisitStart",
                                                                            "type" : "QueryLetRef"
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "98:39-98:52",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "98:39-98:52",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "204",
                                                                        "locator" : "98:67-98:76",
                                                                        "name" : "VisitStart",
                                                                        "type" : "QueryLetRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "210",
                                                        "locator" : "99:6-100:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "209",
                                                                "locator" : "100:6-100:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "208",
                                                                    "locator" : "100:6-100:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "207",
                                                                        "locator" : "100:13-100:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        {
                                            "localId" : "219",
                                            "locator" : "102:4-102:74",
                                            "identifier" : "VisitStartWithED",
                                            "expression" : {
                                                "localId" : "218",
                                                "locator" : "102:22-102:74",
                                                "type" : "Coalesce",
                                                "operand" : [
                                                    {
                                                        "localId" : "216",
                                                        "locator" : "102:31-102:61",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "215",
                                                            "locator" : "102:40-102:61",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "214",
                                                                "locator" : "102:40-102:46",
                                                                "name" : "EDVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "localId" : "217",
                                                        "locator" : "102:64-102:73",
                                                        "name" : "VisitStart",
                                                        "type" : "QueryLetRef"
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "233",
                                            "locator" : "103:4-107:4",
                                            "identifier" : "OutpatientSurgeryVisit",
                                            "expression" : {
                                                "localId" : "232",
                                                "locator" : "103:28-107:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "231",
                                                    "locator" : "103:33-106:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "221",
                                                            "locator" : "103:33-103:100",
                                                            "alias" : "LastSurgeryOP",
                                                            "expression" : {
                                                                "localId" : "220",
                                                                "locator" : "103:33-103:86",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "103:58-103:85",
                                                                    "name" : "Outpatient Surgery Service",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "226",
                                                        "locator" : "104:6-104:89",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "104:46-104:59",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "104:41-104:44",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "223",
                                                                            "locator" : "104:12-104:39",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastSurgeryOP",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "104:46-104:59",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "104:74-104:89",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "224",
                                                                                    "locator" : "104:74-104:89",
                                                                                    "name" : "VisitStartWithED",
                                                                                    "type" : "QueryLetRef"
                                                                                },
                                                                                {
                                                                                    "localId" : "225",
                                                                                    "locator" : "104:46-104:51",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "224",
                                                                            "locator" : "104:74-104:89",
                                                                            "name" : "VisitStartWithED",
                                                                            "type" : "QueryLetRef"
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "104:46-104:59",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "104:46-104:59",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "224",
                                                                        "locator" : "104:74-104:89",
                                                                        "name" : "VisitStartWithED",
                                                                        "type" : "QueryLetRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "230",
                                                        "locator" : "105:6-106:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "229",
                                                                "locator" : "106:6-106:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "228",
                                                                    "locator" : "106:6-106:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "227",
                                                                        "locator" : "106:13-106:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "243",
                                        "locator" : "108:4-109:31",
                                        "expression" : {
                                            "localId" : "242",
                                            "locator" : "108:11-109:31",
                                            "lowClosed" : true,
                                            "highClosed" : true,
                                            "type" : "Interval",
                                            "low" : {
                                                "localId" : "238",
                                                "locator" : "108:20-108:93",
                                                "type" : "Coalesce",
                                                "operand" : [
                                                    {
                                                        "localId" : "236",
                                                        "locator" : "108:29-108:74",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "235",
                                                            "locator" : "108:38-108:74",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "234",
                                                                "locator" : "108:38-108:59",
                                                                "name" : "OutpatientSurgeryVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "localId" : "237",
                                                        "locator" : "108:77-108:92",
                                                        "name" : "VisitStartWithED",
                                                        "type" : "QueryLetRef"
                                                    }
                                                ]
                                            },
                                            "high" : {
                                                "localId" : "241",
                                                "locator" : "109:4-109:30",
                                                "type" : "End",
                                                "operand" : {
                                                    "localId" : "240",
                                                    "locator" : "109:11-109:30",
                                                    "path" : "relevantPeriod",
                                                    "scope" : "Visit",
                                                    "type" : "Property"
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "173",
                                            "locator" : "89:87-89:108",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "298",
                                "locator" : "112:1-126:31",
                                "name" : "HospitalizationWithObservation",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "298",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*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 function ",
                                                        "\"HospitalizationWithObservation\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "246",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "297",
                                                    "s" : [
                                                        {
                                                            "r" : "297",
                                                            "s" : [
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "r" : "248",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "247",
                                                                                    "s" : [
                                                                                        {
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "Encounter"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " ",
                                                                                        "Visit"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "let "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "264",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "ObsVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "263",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "262",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "250",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "249",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "249",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Observation Services\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastObs"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "257",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "257",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "252",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "251",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastObs"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "252",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "257",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "256",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "255",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "start of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "254",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "r" : "253",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "Visit"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "."
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "r" : "254",
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "relevantPeriod"
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "261",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "260",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "259",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "258",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n  \t"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "272",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "VisitStart",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "271",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Coalesce",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "267",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "266",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "265",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "ObsVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "266",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "270",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "269",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "268",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Visit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "269",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ",\n  \t"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "286",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "EDVisit",
                                                                                        ": "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "285",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Last",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "284",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "274",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "273",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "273",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "[",
                                                                                                                                        "\"Encounter, Performed\"",
                                                                                                                                        ": "
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "s" : [
                                                                                                                                        {
                                                                                                                                            "value" : [
                                                                                                                                                "\"Emergency Department Visit\""
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "]"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " ",
                                                                                                                        "LastED"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "279",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "where "
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "279",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "276",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "r" : "275",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "LastED"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "."
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "276",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "279",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "ends "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "278",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "1 ",
                                                                                                                                        "hour"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                " or less on or before"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        " "
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "r" : "277",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "VisitStart"
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "\n  \t\t\t"
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "283",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "sort by \n  \t\t\t"
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "282",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "r" : "281",
                                                                                                                    "s" : [
                                                                                                                        {
                                                                                                                            "value" : [
                                                                                                                                "end of "
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "r" : "280",
                                                                                                                            "s" : [
                                                                                                                                {
                                                                                                                                    "value" : [
                                                                                                                                        "relevantPeriod"
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n  \t)"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  \t"
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "296",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "return "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "295",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Interval["
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "291",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Coalesce",
                                                                                                "("
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "289",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "288",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "287",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "EDVisit"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "288",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ", "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "290",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "VisitStart"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ")"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ", \n  \t"
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "294",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "end of "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "293",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "292",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "Visit"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "."
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "293",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "relevantPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "]"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "297",
                                    "locator" : "113:3-126:31",
                                    "type" : "Query",
                                    "source" : [
                                        {
                                            "localId" : "248",
                                            "locator" : "113:3-113:17",
                                            "alias" : "Visit",
                                            "expression" : {
                                                "localId" : "247",
                                                "locator" : "113:3-113:11",
                                                "name" : "Encounter",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    ],
                                    "let" : [
                                        {
                                            "localId" : "264",
                                            "locator" : "114:8-118:4",
                                            "identifier" : "ObsVisit",
                                            "expression" : {
                                                "localId" : "263",
                                                "locator" : "114:18-118:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "262",
                                                    "locator" : "114:23-117:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "250",
                                                            "locator" : "114:23-114:78",
                                                            "alias" : "LastObs",
                                                            "expression" : {
                                                                "localId" : "249",
                                                                "locator" : "114:23-114:70",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "114:48-114:69",
                                                                    "name" : "Observation Services",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "257",
                                                        "locator" : "115:6-115:96",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "115:40-115:53",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "115:35-115:38",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "252",
                                                                            "locator" : "115:12-115:33",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastObs",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "115:40-115:53",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "115:68-115:96",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "255",
                                                                                    "locator" : "115:68-115:96",
                                                                                    "type" : "Start",
                                                                                    "operand" : {
                                                                                        "localId" : "254",
                                                                                        "locator" : "115:77-115:96",
                                                                                        "path" : "relevantPeriod",
                                                                                        "scope" : "Visit",
                                                                                        "type" : "Property"
                                                                                    }
                                                                                },
                                                                                {
                                                                                    "localId" : "256",
                                                                                    "locator" : "115:40-115:45",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "255",
                                                                            "locator" : "115:68-115:96",
                                                                            "type" : "Start",
                                                                            "operand" : {
                                                                                "localId" : "254",
                                                                                "locator" : "115:77-115:96",
                                                                                "path" : "relevantPeriod",
                                                                                "scope" : "Visit",
                                                                                "type" : "Property"
                                                                            }
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "115:40-115:53",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "115:40-115:53",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "255",
                                                                        "locator" : "115:68-115:96",
                                                                        "type" : "Start",
                                                                        "operand" : {
                                                                            "localId" : "254",
                                                                            "locator" : "115:77-115:96",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "Visit",
                                                                            "type" : "Property"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "261",
                                                        "locator" : "116:6-117:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "260",
                                                                "locator" : "117:6-117:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "259",
                                                                    "locator" : "117:6-117:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "258",
                                                                        "locator" : "117:13-117:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        {
                                            "localId" : "272",
                                            "locator" : "119:4-119:88",
                                            "identifier" : "VisitStart",
                                            "expression" : {
                                                "localId" : "271",
                                                "locator" : "119:16-119:88",
                                                "type" : "Coalesce",
                                                "operand" : [
                                                    {
                                                        "localId" : "267",
                                                        "locator" : "119:25-119:56",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "266",
                                                            "locator" : "119:34-119:56",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "265",
                                                                "locator" : "119:34-119:41",
                                                                "name" : "ObsVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "localId" : "270",
                                                        "locator" : "119:59-119:87",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "269",
                                                            "locator" : "119:68-119:87",
                                                            "path" : "relevantPeriod",
                                                            "scope" : "Visit",
                                                            "type" : "Property"
                                                        }
                                                    }
                                                ]
                                            }
                                        },
                                        {
                                            "localId" : "286",
                                            "locator" : "120:4-124:4",
                                            "identifier" : "EDVisit",
                                            "expression" : {
                                                "localId" : "285",
                                                "locator" : "120:13-124:4",
                                                "type" : "Last",
                                                "source" : {
                                                    "localId" : "284",
                                                    "locator" : "120:18-123:26",
                                                    "type" : "Query",
                                                    "source" : [
                                                        {
                                                            "localId" : "274",
                                                            "locator" : "120:18-120:78",
                                                            "alias" : "LastED",
                                                            "expression" : {
                                                                "localId" : "273",
                                                                "locator" : "120:18-120:71",
                                                                "dataType" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                                                "templateId" : "PositiveEncounterPerformed",
                                                                "codeProperty" : "code",
                                                                "codeComparator" : "in",
                                                                "type" : "Retrieve",
                                                                "codes" : {
                                                                    "locator" : "120:43-120:70",
                                                                    "name" : "Emergency Department Visit",
                                                                    "type" : "ValueSetRef"
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    "relationship" : [

                                                    ],
                                                    "where" : {
                                                        "localId" : "279",
                                                        "locator" : "121:6-121:76",
                                                        "type" : "And",
                                                        "operand" : [
                                                            {
                                                                "locator" : "121:39-121:52",
                                                                "type" : "In",
                                                                "operand" : [
                                                                    {
                                                                        "locator" : "121:34-121:37",
                                                                        "type" : "End",
                                                                        "operand" : {
                                                                            "localId" : "276",
                                                                            "locator" : "121:12-121:32",
                                                                            "path" : "relevantPeriod",
                                                                            "scope" : "LastED",
                                                                            "type" : "Property"
                                                                        }
                                                                    },
                                                                    {
                                                                        "locator" : "121:39-121:52",
                                                                        "lowClosed" : true,
                                                                        "highClosed" : true,
                                                                        "type" : "Interval",
                                                                        "low" : {
                                                                            "locator" : "121:67-121:76",
                                                                            "type" : "Subtract",
                                                                            "operand" : [
                                                                                {
                                                                                    "localId" : "277",
                                                                                    "locator" : "121:67-121:76",
                                                                                    "name" : "VisitStart",
                                                                                    "type" : "QueryLetRef"
                                                                                },
                                                                                {
                                                                                    "localId" : "278",
                                                                                    "locator" : "121:39-121:44",
                                                                                    "value" : 1,
                                                                                    "unit" : "hour",
                                                                                    "type" : "Quantity"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "high" : {
                                                                            "localId" : "277",
                                                                            "locator" : "121:67-121:76",
                                                                            "name" : "VisitStart",
                                                                            "type" : "QueryLetRef"
                                                                        }
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "locator" : "121:39-121:52",
                                                                "type" : "Not",
                                                                "operand" : {
                                                                    "locator" : "121:39-121:52",
                                                                    "type" : "IsNull",
                                                                    "operand" : {
                                                                        "localId" : "277",
                                                                        "locator" : "121:67-121:76",
                                                                        "name" : "VisitStart",
                                                                        "type" : "QueryLetRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    },
                                                    "sort" : {
                                                        "localId" : "283",
                                                        "locator" : "122:6-123:26",
                                                        "by" : [
                                                            {
                                                                "localId" : "282",
                                                                "locator" : "123:6-123:26",
                                                                "direction" : "asc",
                                                                "type" : "ByExpression",
                                                                "expression" : {
                                                                    "localId" : "281",
                                                                    "locator" : "123:6-123:26",
                                                                    "type" : "End",
                                                                    "operand" : {
                                                                        "localId" : "280",
                                                                        "locator" : "123:13-123:26",
                                                                        "name" : "relevantPeriod",
                                                                        "type" : "IdentifierRef"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    ],
                                    "relationship" : [

                                    ],
                                    "return" : {
                                        "localId" : "296",
                                        "locator" : "125:4-126:31",
                                        "expression" : {
                                            "localId" : "295",
                                            "locator" : "125:11-126:31",
                                            "lowClosed" : true,
                                            "highClosed" : true,
                                            "type" : "Interval",
                                            "low" : {
                                                "localId" : "291",
                                                "locator" : "125:20-125:72",
                                                "type" : "Coalesce",
                                                "operand" : [
                                                    {
                                                        "localId" : "289",
                                                        "locator" : "125:29-125:59",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "288",
                                                            "locator" : "125:38-125:59",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "287",
                                                                "locator" : "125:38-125:44",
                                                                "name" : "EDVisit",
                                                                "type" : "QueryLetRef"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "localId" : "290",
                                                        "locator" : "125:62-125:71",
                                                        "name" : "VisitStart",
                                                        "type" : "QueryLetRef"
                                                    }
                                                ]
                                            },
                                            "high" : {
                                                "localId" : "294",
                                                "locator" : "126:4-126:30",
                                                "type" : "End",
                                                "operand" : {
                                                    "localId" : "293",
                                                    "locator" : "126:11-126:30",
                                                    "path" : "relevantPeriod",
                                                    "scope" : "Visit",
                                                    "type" : "Property"
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "246",
                                            "locator" : "112:60-112:81",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "303",
                                "locator" : "129:1-130:61",
                                "name" : "HospitalizationWithObservationLengthofStay",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "303",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Hospitalization with Observation Length of Stay returns the length in days from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter*/",
                                                        "define function ",
                                                        "\"HospitalizationWithObservationLengthofStay\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "299",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "302",
                                                    "s" : [
                                                        {
                                                            "r" : "302",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "\"LengthInDays\"",
                                                                        "("
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "301",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "\"HospitalizationWithObservation\"",
                                                                                "("
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "300",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "Encounter"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ")"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "302",
                                    "locator" : "130:3-130:61",
                                    "name" : "LengthInDays",
                                    "type" : "FunctionRef",
                                    "operand" : [
                                        {
                                            "localId" : "301",
                                            "locator" : "130:18-130:60",
                                            "name" : "HospitalizationWithObservation",
                                            "type" : "FunctionRef",
                                            "operand" : [
                                                {
                                                    "localId" : "300",
                                                    "locator" : "130:51-130:59",
                                                    "name" : "Encounter",
                                                    "type" : "OperandRef"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "299",
                                            "locator" : "129:72-129:93",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "324",
                                "locator" : "133:1-138:3",
                                "name" : "FirstInpatientIntensiveCareUnit",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "324",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*First Inpatient Intensive Care Unit returns the first intensive care unit for the given encounter, without considering any immediately prior emergency department visit.*/",
                                                        "define function ",
                                                        "\"FirstInpatientIntensiveCareUnit\"",
                                                        "(",
                                                        "Encounter",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "304",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "\"Encounter, Performed\""
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "323",
                                                    "s" : [
                                                        {
                                                            "r" : "323",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "First",
                                                                        "("
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "322",
                                                                    "s" : [
                                                                        {
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "307",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "306",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "("
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "306",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "305",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Encounter"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "306",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "facilityLocations"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        ")"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "HospitalLocation"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "317",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "where "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "317",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "311",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "309",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "308",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "HospitalLocation"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "309",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "code"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "value" : [
                                                                                                        " in "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "310",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "\"Intensive Care Unit\""
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                "\n        and "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "316",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "r" : "313",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "312",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "HospitalLocation"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "313",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "locationPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "316",
                                                                                                    "value" : [
                                                                                                        " ",
                                                                                                        "during",
                                                                                                        " "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "315",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "r" : "314",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "Encounter"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "."
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "r" : "315",
                                                                                                            "s" : [
                                                                                                                {
                                                                                                                    "value" : [
                                                                                                                        "relevantPeriod"
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n      "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "321",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "sort by "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "320",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "319",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "318",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "locationPeriod"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n  )"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "323",
                                    "locator" : "134:3-138:3",
                                    "type" : "First",
                                    "source" : {
                                        "localId" : "322",
                                        "locator" : "134:9-137:37",
                                        "type" : "Query",
                                        "source" : [
                                            {
                                                "localId" : "307",
                                                "locator" : "134:9-134:53",
                                                "alias" : "HospitalLocation",
                                                "expression" : {
                                                    "localId" : "306",
                                                    "locator" : "134:9-134:37",
                                                    "path" : "facilityLocations",
                                                    "type" : "Property",
                                                    "source" : {
                                                        "localId" : "305",
                                                        "locator" : "134:10-134:18",
                                                        "name" : "Encounter",
                                                        "type" : "OperandRef"
                                                    }
                                                }
                                            }
                                        ],
                                        "relationship" : [

                                        ],
                                        "where" : {
                                            "localId" : "317",
                                            "locator" : "135:7-136:75",
                                            "type" : "And",
                                            "operand" : [
                                                {
                                                    "localId" : "311",
                                                    "locator" : "135:13-135:58",
                                                    "type" : "InValueSet",
                                                    "code" : {
                                                        "localId" : "309",
                                                        "locator" : "135:13-135:33",
                                                        "path" : "code",
                                                        "scope" : "HospitalLocation",
                                                        "type" : "Property"
                                                    },
                                                    "valueset" : {
                                                        "localId" : "310",
                                                        "locator" : "135:38-135:58",
                                                        "name" : "Intensive Care Unit",
                                                        "type" : "ValueSetRef"
                                                    }
                                                },
                                                {
                                                    "localId" : "316",
                                                    "locator" : "136:13-136:75",
                                                    "type" : "IncludedIn",
                                                    "operand" : [
                                                        {
                                                            "localId" : "313",
                                                            "locator" : "136:13-136:43",
                                                            "path" : "locationPeriod",
                                                            "scope" : "HospitalLocation",
                                                            "type" : "Property"
                                                        },
                                                        {
                                                            "localId" : "315",
                                                            "locator" : "136:52-136:75",
                                                            "path" : "relevantPeriod",
                                                            "type" : "Property",
                                                            "source" : {
                                                                "localId" : "314",
                                                                "locator" : "136:52-136:60",
                                                                "name" : "Encounter",
                                                                "type" : "OperandRef"
                                                            }
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "sort" : {
                                            "localId" : "321",
                                            "locator" : "137:7-137:37",
                                            "by" : [
                                                {
                                                    "localId" : "320",
                                                    "locator" : "137:15-137:37",
                                                    "direction" : "asc",
                                                    "type" : "ByExpression",
                                                    "expression" : {
                                                        "localId" : "319",
                                                        "locator" : "137:15-137:37",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "318",
                                                            "locator" : "137:24-137:37",
                                                            "name" : "locationPeriod",
                                                            "type" : "IdentifierRef"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "Encounter",
                                        "operandTypeSpecifier" : {
                                            "localId" : "304",
                                            "locator" : "133:61-133:82",
                                            "name" : "{urn:healthit-gov:qdm:v5_6}PositiveEncounterPerformed",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "342",
                                "locator" : "141:1-144:35",
                                "name" : "NormalizeInterval",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "342",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Given a datetime and a period, returns the period (if a period is provided) or the interval beginning and ending on the datetime (if a datetime is provided)*/",
                                                        "define function ",
                                                        "\"NormalizeInterval\"",
                                                        "(",
                                                        "pointInTime",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "325",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "DateTime"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        ", ",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "327",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "326",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "341",
                                                    "s" : [
                                                        {
                                                            "r" : "341",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "if "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "329",
                                                                    "s" : [
                                                                        {
                                                                            "r" : "328",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "pointInTime"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " is not null"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " then "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "332",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "Interval["
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "330",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "pointInTime"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ", "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "331",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "pointInTime"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "]"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        "\n    else "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "340",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "if "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "334",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "333",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        " is not null"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " then "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "335",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                " \n    else "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "339",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "336",
                                                                                    "value" : [
                                                                                        "null",
                                                                                        " as "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "338",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "Interval<"
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "337",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "DateTime"
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                ">"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "341",
                                    "locator" : "142:3-144:35",
                                    "type" : "If",
                                    "condition" : {
                                        "localId" : "329",
                                        "locator" : "142:6-142:28",
                                        "type" : "Not",
                                        "operand" : {
                                            "locator" : "142:6-142:28",
                                            "type" : "IsNull",
                                            "operand" : {
                                                "localId" : "328",
                                                "locator" : "142:6-142:16",
                                                "name" : "pointInTime",
                                                "type" : "OperandRef"
                                            }
                                        }
                                    },
                                    "then" : {
                                        "localId" : "332",
                                        "locator" : "142:35-142:68",
                                        "lowClosed" : true,
                                        "highClosed" : true,
                                        "type" : "Interval",
                                        "low" : {
                                            "localId" : "330",
                                            "locator" : "142:44-142:54",
                                            "name" : "pointInTime",
                                            "type" : "OperandRef"
                                        },
                                        "high" : {
                                            "localId" : "331",
                                            "locator" : "142:57-142:67",
                                            "name" : "pointInTime",
                                            "type" : "OperandRef"
                                        }
                                    },
                                    "else" : {
                                        "localId" : "340",
                                        "locator" : "143:10-144:35",
                                        "type" : "If",
                                        "condition" : {
                                            "localId" : "334",
                                            "locator" : "143:13-143:30",
                                            "type" : "Not",
                                            "operand" : {
                                                "locator" : "143:13-143:30",
                                                "type" : "IsNull",
                                                "operand" : {
                                                    "localId" : "333",
                                                    "locator" : "143:13-143:18",
                                                    "name" : "period",
                                                    "type" : "OperandRef"
                                                }
                                            }
                                        },
                                        "then" : {
                                            "localId" : "335",
                                            "locator" : "143:37-143:42",
                                            "name" : "period",
                                            "type" : "OperandRef"
                                        },
                                        "else" : {
                                            "localId" : "339",
                                            "locator" : "144:10-144:35",
                                            "strict" : false,
                                            "type" : "As",
                                            "operand" : {
                                                "localId" : "336",
                                                "locator" : "144:10-144:13",
                                                "type" : "Null"
                                            },
                                            "asTypeSpecifier" : {
                                                "localId" : "338",
                                                "locator" : "144:18-144:35",
                                                "type" : "IntervalTypeSpecifier",
                                                "pointType" : {
                                                    "localId" : "337",
                                                    "locator" : "144:27-144:34",
                                                    "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                    "type" : "NamedTypeSpecifier"
                                                }
                                            }
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "pointInTime",
                                        "operandTypeSpecifier" : {
                                            "localId" : "325",
                                            "locator" : "141:49-141:56",
                                            "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    },
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "327",
                                            "locator" : "141:66-141:83",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "326",
                                                "locator" : "141:75-141:82",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "355",
                                "locator" : "147:1-150:3",
                                "name" : "HasStart",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "355",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*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 function ",
                                                        "\"HasStart\"",
                                                        "(",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "344",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "343",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "354",
                                                    "s" : [
                                                        {
                                                            "r" : "354",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "not "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "353",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "( "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "353",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "347",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "346",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "345",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " is null"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n      or "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "352",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "349",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "start of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "348",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " ",
                                                                                                "=",
                                                                                                " "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "351",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "minimum",
                                                                                                        " "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "350",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "DateTime"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n  )"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "354",
                                    "locator" : "148:3-150:3",
                                    "type" : "Not",
                                    "operand" : {
                                        "localId" : "353",
                                        "locator" : "148:7-150:3",
                                        "type" : "Or",
                                        "operand" : [
                                            {
                                                "localId" : "347",
                                                "locator" : "148:9-148:31",
                                                "type" : "IsNull",
                                                "operand" : {
                                                    "localId" : "346",
                                                    "locator" : "148:9-148:23",
                                                    "type" : "Start",
                                                    "operand" : {
                                                        "localId" : "345",
                                                        "locator" : "148:18-148:23",
                                                        "name" : "period",
                                                        "type" : "OperandRef"
                                                    }
                                                }
                                            },
                                            {
                                                "localId" : "352",
                                                "locator" : "149:10-149:43",
                                                "type" : "Equal",
                                                "operand" : [
                                                    {
                                                        "localId" : "349",
                                                        "locator" : "149:10-149:24",
                                                        "type" : "Start",
                                                        "operand" : {
                                                            "localId" : "348",
                                                            "locator" : "149:19-149:24",
                                                            "name" : "period",
                                                            "type" : "OperandRef"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "351",
                                                        "locator" : "149:28-149:43",
                                                        "valueType" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                        "type" : "MinValue"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "344",
                                            "locator" : "147:35-147:52",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "343",
                                                "locator" : "147:44-147:51",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "368",
                                "locator" : "153:1-158:3",
                                "name" : "HasEnd",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "368",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Given an interval, return true if the interval has an ending boundary specified (i.e. the end of the interval is not null and not the maximum DateTime value)*/",
                                                        "define function ",
                                                        "\"HasEnd\"",
                                                        "(",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "357",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "356",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "367",
                                                    "s" : [
                                                        {
                                                            "r" : "367",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "not "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "366",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "( \n    "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "366",
                                                                            "s" : [
                                                                                {
                                                                                    "r" : "360",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "359",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "end of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "358",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " is null"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        "\n      or \n      "
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "365",
                                                                                    "s" : [
                                                                                        {
                                                                                            "r" : "362",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "end of "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "361",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "period"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "value" : [
                                                                                                " ",
                                                                                                "=",
                                                                                                " "
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "r" : "364",
                                                                                            "s" : [
                                                                                                {
                                                                                                    "value" : [
                                                                                                        "maximum",
                                                                                                        " "
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "r" : "363",
                                                                                                    "s" : [
                                                                                                        {
                                                                                                            "value" : [
                                                                                                                "DateTime"
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                "\n  )"
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "367",
                                    "locator" : "154:3-158:3",
                                    "type" : "Not",
                                    "operand" : {
                                        "localId" : "366",
                                        "locator" : "154:7-158:3",
                                        "type" : "Or",
                                        "operand" : [
                                            {
                                                "localId" : "360",
                                                "locator" : "155:5-155:25",
                                                "type" : "IsNull",
                                                "operand" : {
                                                    "localId" : "359",
                                                    "locator" : "155:5-155:17",
                                                    "type" : "End",
                                                    "operand" : {
                                                        "localId" : "358",
                                                        "locator" : "155:12-155:17",
                                                        "name" : "period",
                                                        "type" : "OperandRef"
                                                    }
                                                }
                                            },
                                            {
                                                "localId" : "365",
                                                "locator" : "157:7-157:38",
                                                "type" : "Equal",
                                                "operand" : [
                                                    {
                                                        "localId" : "362",
                                                        "locator" : "157:7-157:19",
                                                        "type" : "End",
                                                        "operand" : {
                                                            "localId" : "361",
                                                            "locator" : "157:14-157:19",
                                                            "name" : "period",
                                                            "type" : "OperandRef"
                                                        }
                                                    },
                                                    {
                                                        "localId" : "364",
                                                        "locator" : "157:23-157:38",
                                                        "valueType" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                        "type" : "MaxValue"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "357",
                                            "locator" : "153:33-153:50",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "356",
                                                "locator" : "153:42-153:49",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "378",
                                "locator" : "161:1-164:24",
                                "name" : "Latest",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "378",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Given an interval, return the ending point if the interval has an ending boundary specified, otherwise, return the starting point*/",
                                                        "define function ",
                                                        "\"Latest\"",
                                                        "(",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "370",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "369",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "377",
                                                    "s" : [
                                                        {
                                                            "r" : "377",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "if "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "372",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "( "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "372",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "HasEnd",
                                                                                        "("
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "371",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ")"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " then \n  "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "374",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "end of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "373",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " \n    else "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "376",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "start of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "375",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "377",
                                    "locator" : "162:3-164:24",
                                    "type" : "If",
                                    "condition" : {
                                        "localId" : "372",
                                        "locator" : "162:6-162:22",
                                        "name" : "HasEnd",
                                        "type" : "FunctionRef",
                                        "operand" : [
                                            {
                                                "localId" : "371",
                                                "locator" : "162:15-162:20",
                                                "name" : "period",
                                                "type" : "OperandRef"
                                            }
                                        ]
                                    },
                                    "then" : {
                                        "localId" : "374",
                                        "locator" : "163:3-163:15",
                                        "type" : "End",
                                        "operand" : {
                                            "localId" : "373",
                                            "locator" : "163:10-163:15",
                                            "name" : "period",
                                            "type" : "OperandRef"
                                        }
                                    },
                                    "else" : {
                                        "localId" : "376",
                                        "locator" : "164:10-164:24",
                                        "type" : "Start",
                                        "operand" : {
                                            "localId" : "375",
                                            "locator" : "164:19-164:24",
                                            "name" : "period",
                                            "type" : "OperandRef"
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "370",
                                            "locator" : "161:33-161:50",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "369",
                                                "locator" : "161:42-161:49",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "388",
                                "locator" : "167:1-170:15",
                                "name" : "Earliest",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "388",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Given an interval, return the starting point if the interval has a starting boundary specified, otherwise, return the ending point*/",
                                                        "define function ",
                                                        "\"Earliest\"",
                                                        "(",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "380",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "379",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "387",
                                                    "s" : [
                                                        {
                                                            "r" : "387",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "if "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "382",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "( "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "382",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "HasStart",
                                                                                        "("
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "r" : "381",
                                                                                    "s" : [
                                                                                        {
                                                                                            "value" : [
                                                                                                "period"
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "value" : [
                                                                                        ")"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " then "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "384",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "start of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "383",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        " \n    else \n  "
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "386",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "end of "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "385",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "387",
                                    "locator" : "168:3-170:15",
                                    "type" : "If",
                                    "condition" : {
                                        "localId" : "382",
                                        "locator" : "168:6-168:24",
                                        "name" : "HasStart",
                                        "type" : "FunctionRef",
                                        "operand" : [
                                            {
                                                "localId" : "381",
                                                "locator" : "168:17-168:22",
                                                "name" : "period",
                                                "type" : "OperandRef"
                                            }
                                        ]
                                    },
                                    "then" : {
                                        "localId" : "384",
                                        "locator" : "168:31-168:45",
                                        "type" : "Start",
                                        "operand" : {
                                            "localId" : "383",
                                            "locator" : "168:40-168:45",
                                            "name" : "period",
                                            "type" : "OperandRef"
                                        }
                                    },
                                    "else" : {
                                        "localId" : "386",
                                        "locator" : "170:3-170:15",
                                        "type" : "End",
                                        "operand" : {
                                            "localId" : "385",
                                            "locator" : "170:10-170:15",
                                            "name" : "period",
                                            "type" : "OperandRef"
                                        }
                                    }
                                },
                                "operand" : [
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "380",
                                            "locator" : "167:35-167:52",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "379",
                                                "locator" : "167:44-167:51",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "396",
                                "locator" : "173:1-174:48",
                                "name" : "LatestOf",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "396",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Given a pointInTime or period, if the pointInTime is specified, returns the pointInTime, returns the ending point of the period if the period has an ending boundary specified, otherwise returns the starting point of the interval*/",
                                                        "define function ",
                                                        "\"LatestOf\"",
                                                        "(",
                                                        "pointInTime",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "389",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "DateTime"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        ", ",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "391",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "390",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "395",
                                                    "s" : [
                                                        {
                                                            "r" : "395",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "Latest",
                                                                        "("
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "394",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "NormalizeInterval",
                                                                                "("
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "392",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "pointInTime"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ", "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "393",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ")"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "395",
                                    "locator" : "174:3-174:48",
                                    "name" : "Latest",
                                    "type" : "FunctionRef",
                                    "operand" : [
                                        {
                                            "localId" : "394",
                                            "locator" : "174:10-174:47",
                                            "name" : "NormalizeInterval",
                                            "type" : "FunctionRef",
                                            "operand" : [
                                                {
                                                    "localId" : "392",
                                                    "locator" : "174:28-174:38",
                                                    "name" : "pointInTime",
                                                    "type" : "OperandRef"
                                                },
                                                {
                                                    "localId" : "393",
                                                    "locator" : "174:41-174:46",
                                                    "name" : "period",
                                                    "type" : "OperandRef"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "operand" : [
                                    {
                                        "name" : "pointInTime",
                                        "operandTypeSpecifier" : {
                                            "localId" : "389",
                                            "locator" : "173:40-173:47",
                                            "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    },
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "391",
                                            "locator" : "173:57-173:74",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "390",
                                                "locator" : "173:66-173:73",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "localId" : "404",
                                "locator" : "177:1-178:50",
                                "name" : "EarliestOf",
                                "context" : "Patient",
                                "accessLevel" : "Public",
                                "type" : "FunctionDef",
                                "annotation" : [
                                    {
                                        "type" : "Annotation",
                                        "s" : {
                                            "r" : "404",
                                            "s" : [
                                                {
                                                    "value" : [
                                                        "/*Given a pointInTime or period, if the pointInTime is specified, returns the pointInTime, returns the starting point of the period if the period has a starting boundary specified, otherwise returns the ending point of the period*/",
                                                        "define function ",
                                                        "\"EarliestOf\"",
                                                        "(",
                                                        "pointInTime",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "397",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "DateTime"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        ", ",
                                                        "period",
                                                        " "
                                                    ]
                                                },
                                                {
                                                    "r" : "399",
                                                    "s" : [
                                                        {
                                                            "value" : [
                                                                "Interval<"
                                                            ]
                                                        },
                                                        {
                                                            "r" : "398",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "DateTime"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "value" : [
                                                                ">"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "value" : [
                                                        " ):\n  "
                                                    ]
                                                },
                                                {
                                                    "r" : "403",
                                                    "s" : [
                                                        {
                                                            "r" : "403",
                                                            "s" : [
                                                                {
                                                                    "value" : [
                                                                        "Earliest",
                                                                        "("
                                                                    ]
                                                                },
                                                                {
                                                                    "r" : "402",
                                                                    "s" : [
                                                                        {
                                                                            "value" : [
                                                                                "NormalizeInterval",
                                                                                "("
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "400",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "pointInTime"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ", "
                                                                            ]
                                                                        },
                                                                        {
                                                                            "r" : "401",
                                                                            "s" : [
                                                                                {
                                                                                    "value" : [
                                                                                        "period"
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "value" : [
                                                                                ")"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "value" : [
                                                                        ")"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "expression" : {
                                    "localId" : "403",
                                    "locator" : "178:3-178:50",
                                    "name" : "Earliest",
                                    "type" : "FunctionRef",
                                    "operand" : [
                                        {
                                            "localId" : "402",
                                            "locator" : "178:12-178:49",
                                            "name" : "NormalizeInterval",
                                            "type" : "FunctionRef",
                                            "operand" : [
                                                {
                                                    "localId" : "400",
                                                    "locator" : "178:30-178:40",
                                                    "name" : "pointInTime",
                                                    "type" : "OperandRef"
                                                },
                                                {
                                                    "localId" : "401",
                                                    "locator" : "178:43-178:48",
                                                    "name" : "period",
                                                    "type" : "OperandRef"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "operand" : [
                                    {
                                        "name" : "pointInTime",
                                        "operandTypeSpecifier" : {
                                            "localId" : "397",
                                            "locator" : "177:42-177:49",
                                            "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                            "type" : "NamedTypeSpecifier"
                                        }
                                    },
                                    {
                                        "name" : "period",
                                        "operandTypeSpecifier" : {
                                            "localId" : "399",
                                            "locator" : "177:59-177:76",
                                            "type" : "IntervalTypeSpecifier",
                                            "pointType" : {
                                                "localId" : "398",
                                                "locator" : "177:68-177:75",
                                                "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                                "type" : "NamedTypeSpecifier"
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                }
            },
            "cql" : "library MATGlobalCommonFunctions version '7.0.000'\n\nusing QDM version '5.6'\n\nvalueset \"Emergency Department Visit\": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.292' \nvalueset \"Encounter Inpatient\": 'urn:oid:2.16.840.1.113883.3.666.5.307' \nvalueset \"Intensive Care Unit\": 'urn:oid:2.16.840.1.113762.1.4.1029.206' \nvalueset \"Observation Services\": 'urn:oid:2.16.840.1.113762.1.4.1111.143' \nvalueset \"Outpatient Surgery Service\": 'urn:oid:2.16.840.1.113762.1.4.1110.38' \n\nparameter \"Measurement Period\" Interval<DateTime>\n\ncontext Patient\n\ndefine \"ED Encounter\":\n  [\"Encounter, Performed\": \"Emergency Department Visit\"]\n\ndefine \"Inpatient Encounter\":\n  [\"Encounter, Performed\": \"Encounter Inpatient\"] EncounterInpatient\n    where \"LengthInDays\"(EncounterInpatient.relevantPeriod)<= 120\n      and EncounterInpatient.relevantPeriod ends during day of \"Measurement Period\"\n\n/*@description: Returns an interval of date values extracted from the input interval of date-time values\n@comment: This function returns an interval constructed using the `date from` extractor on the start\nand end values of the input date-time interval. Note that using a precision specifier as part of a\ntiming phrase is preferred to communicate intent to perform day-level comparison, as well as for\ngeneral readability.*/\ndefine function \"ToDateInterval\"(period Interval<DateTime> ):\n  Interval[date from start of period, date from end of period]\n\n/*calculates the difference in calendar days between the start and end of the given interval.*/\ndefine function \"LengthInDays\"(Value Interval<DateTime> ):\n  difference in days between start of Value and end of Value\n\n/*returns list of all locations within an encounter, including locations for immediately prior ED visit.*/\ndefine function \"HospitalizationLocations\"(Encounter \"Encounter, Performed\" ):\n  Encounter Visit\n  \tlet EDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n  \t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t)\n  \treturn if EDVisit is null then Visit.facilityLocations \n  \t\telse flatten { EDVisit.facilityLocations, Visit.facilityLocations }\n\n/*Returns the arrival time in the ED for the encounter.*/\ndefine function \"EmergencyDepartmentArrivalTime\"(Encounter \"Encounter, Performed\" ):\n  start of First((\"HospitalizationLocations\"(Encounter))HospitalLocation\n  \t\twhere HospitalLocation.code in \"Emergency Department Visit\"\n  \t\tsort by start of locationPeriod\n  ).locationPeriod\n\n/*Returns admission time for an encounter or for immediately prior emergency department visit.*/\ndefine function \"HospitalAdmissionTime\"(Encounter \"Encounter, Performed\" ):\n  start of \"Hospitalization\"(Encounter)\n\n/*Returns earliest arrival time for an encounter including any prior ED visit.*/\ndefine function \"HospitalArrivalTime\"(Encounter \"Encounter, Performed\" ):\n  start of First((\"HospitalizationLocations\"(Encounter))HospitalLocation\n  \t\tsort by start of locationPeriod\n  ).locationPeriod\n\n/*Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.*/\ndefine function \"Hospitalization\"(Encounter \"Encounter, Performed\" ):\n  Encounter Visit\n  \tlet EDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n  \t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t)\n  \treturn Interval[Coalesce(start of EDVisit.relevantPeriod, start of Visit.relevantPeriod), \n  \tend of Visit.relevantPeriod]\n\n/*Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter*/\ndefine function \"HospitalizationLengthofStay\"(Encounter \"Encounter, Performed\" ):\n  LengthInDays(\"Hospitalization\"(Encounter))\n\n/*Returns the latest departure time for encounter including any prior ED visit.*/\ndefine function \"HospitalDepartureTime\"(Encounter \"Encounter, Performed\" ):\n  end of Last((\"HospitalizationLocations\"(Encounter))HospitalLocation\n  \t\tsort by start of locationPeriod\n  ).locationPeriod\n\n/*Hospital Discharge Time returns the discharge time for an encounter*/\ndefine function \"HospitalDischargeTime\"(Encounter \"Encounter, Performed\" ):\n  end of Encounter.relevantPeriod\n\n/*Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.*/\ndefine function \"HospitalizationWithObservationAndOutpatientSurgeryService\"(Encounter \"Encounter, Performed\" ):\n  Encounter Visit\n  \tlet ObsVisit: Last([\"Encounter, Performed\": \"Observation Services\"] LastObs\n  \t\t\twhere LastObs.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t),\n  \tVisitStart: Coalesce(start of ObsVisit.relevantPeriod, start of Visit.relevantPeriod),\n  \tEDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n  \t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before VisitStart\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t),\n  \tVisitStartWithED: Coalesce(start of EDVisit.relevantPeriod, VisitStart),\n  \tOutpatientSurgeryVisit: Last([\"Encounter, Performed\": \"Outpatient Surgery Service\"] LastSurgeryOP\n  \t\t\twhere LastSurgeryOP.relevantPeriod ends 1 hour or less on or before VisitStartWithED\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t)\n  \treturn Interval[Coalesce(start of OutpatientSurgeryVisit.relevantPeriod, VisitStartWithED), \n  \tend of Visit.relevantPeriod]\n\n/*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*/\ndefine function \"HospitalizationWithObservation\"(Encounter \"Encounter, Performed\" ):\n  Encounter Visit\n  \tlet ObsVisit: Last([\"Encounter, Performed\": \"Observation Services\"] LastObs\n  \t\t\twhere LastObs.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t),\n  \tVisitStart: Coalesce(start of ObsVisit.relevantPeriod, start of Visit.relevantPeriod),\n  \tEDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n  \t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before VisitStart\n  \t\t\tsort by \n  \t\t\tend of relevantPeriod\n  \t)\n  \treturn Interval[Coalesce(start of EDVisit.relevantPeriod, VisitStart), \n  \tend of Visit.relevantPeriod]\n\n/*Hospitalization with Observation Length of Stay returns the length in days from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter*/\ndefine function \"HospitalizationWithObservationLengthofStay\"(Encounter \"Encounter, Performed\" ):\n  \"LengthInDays\"(\"HospitalizationWithObservation\"(Encounter))\n\n/*First Inpatient Intensive Care Unit returns the first intensive care unit for the given encounter, without considering any immediately prior emergency department visit.*/\ndefine function \"FirstInpatientIntensiveCareUnit\"(Encounter \"Encounter, Performed\" ):\n  First((Encounter.facilityLocations)HospitalLocation\n      where HospitalLocation.code in \"Intensive Care Unit\"\n        and HospitalLocation.locationPeriod during Encounter.relevantPeriod\n      sort by start of locationPeriod\n  )\n\n/*Given a datetime and a period, returns the period (if a period is provided) or the interval beginning and ending on the datetime (if a datetime is provided)*/\ndefine function \"NormalizeInterval\"(pointInTime DateTime, period Interval<DateTime> ):\n  if pointInTime is not null then Interval[pointInTime, pointInTime]\n    else if period is not null then period \n    else null as Interval<DateTime>\n\n/*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)*/\ndefine function \"HasStart\"(period Interval<DateTime> ):\n  not ( start of period is null\n      or start of period = minimum DateTime\n  )\n\n/*Given an interval, return true if the interval has an ending boundary specified (i.e. the end of the interval is not null and not the maximum DateTime value)*/\ndefine function \"HasEnd\"(period Interval<DateTime> ):\n  not ( \n    end of period is null\n      or \n      end of period = maximum DateTime\n  )\n\n/*Given an interval, return the ending point if the interval has an ending boundary specified, otherwise, return the starting point*/\ndefine function \"Latest\"(period Interval<DateTime> ):\n  if ( HasEnd(period)) then \n  end of period \n    else start of period\n\n/*Given an interval, return the starting point if the interval has a starting boundary specified, otherwise, return the ending point*/\ndefine function \"Earliest\"(period Interval<DateTime> ):\n  if ( HasStart(period)) then start of period \n    else \n  end of period\n\n/*Given a pointInTime or period, if the pointInTime is specified, returns the pointInTime, returns the ending point of the period if the period has an ending boundary specified, otherwise returns the starting point of the interval*/\ndefine function \"LatestOf\"(pointInTime DateTime, period Interval<DateTime> ):\n  Latest(NormalizeInterval(pointInTime, period))\n\n/*Given a pointInTime or period, if the pointInTime is specified, returns the pointInTime, returns the starting point of the period if the period has a starting boundary specified, otherwise returns the ending point of the period*/\ndefine function \"EarliestOf\"(pointInTime DateTime, period Interval<DateTime> ):\n  Earliest(NormalizeInterval(pointInTime, period))\n\n",
            "elm_annotations" : {
                "statements" : [
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"ED Encounter\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "[\"Encounter, Performed\": "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"Emergency Department Visit\""
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "]"
                                                    }
                                                ]
                                            }
                                        ],
                                        "node_type" : "Retrieve",
                                        "ref_id" : "10"
                                    }
                                ],
                                "ref_id" : "11"
                            }
                        ],
                        "define_name" : "ED Encounter"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*calculates the difference in calendar days between the start and end of the given interval.*/define function \"LengthInDays\"(Value "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "16"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "17"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "difference in days between "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "start of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Value"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "18"
                                                            }
                                                        ],
                                                        "node_type" : "Start",
                                                        "ref_id" : "19"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " and "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "end of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Value"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "20"
                                                            }
                                                        ],
                                                        "node_type" : "End",
                                                        "ref_id" : "21"
                                                    }
                                                ],
                                                "node_type" : "DifferenceBetween",
                                                "ref_id" : "22"
                                            }
                                        ],
                                        "node_type" : "DifferenceBetween",
                                        "ref_id" : "22"
                                    }
                                ],
                                "ref_id" : "23"
                            }
                        ],
                        "define_name" : "LengthInDays"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "define \"Inpatient Encounter\":\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "[\"Encounter, Performed\": "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\"Encounter Inpatient\""
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "]"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Retrieve",
                                                                        "ref_id" : "12"
                                                                    }
                                                                ],
                                                                "node_type" : "Retrieve",
                                                                "ref_id" : "12"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " EncounterInpatient"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "13"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\n    "
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "where "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"LengthInDays\"("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "EncounterInpatient"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "14"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "15"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "15"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "FunctionRef",
                                                                        "ref_id" : "24"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "<= 120"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Literal",
                                                                        "ref_id" : "25"
                                                                    }
                                                                ],
                                                                "node_type" : "LessOrEqual",
                                                                "ref_id" : "26"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n      and "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EncounterInpatient"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "27"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "relevantPeriod"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "28"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Property",
                                                                        "ref_id" : "28"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " ends during day of "
                                                                            }
                                                                        ],
                                                                        "node_type" : "In",
                                                                        "ref_id" : "30"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\"Measurement Period\""
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "ParameterRef",
                                                                        "ref_id" : "29"
                                                                    }
                                                                ],
                                                                "node_type" : "In",
                                                                "ref_id" : "30"
                                                            }
                                                        ],
                                                        "ref_id" : "31"
                                                    }
                                                ],
                                                "ref_id" : "31"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "32"
                                    }
                                ],
                                "ref_id" : "33"
                            }
                        ],
                        "define_name" : "Inpatient Encounter"
                    },
                    {
                        "children" : [
                            {
                                "children" : [

                                ]
                            },
                            {
                                "children" : [

                                ]
                            },
                            {
                                "children" : [

                                ]
                            },
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*@description: Returns an interval of date values extracted from the input interval of date-time values\n@comment: This function returns an interval constructed using the `date from` extractor on the start\nand end values of the input date-time interval. Note that using a precision specifier as part of a\ntiming phrase is preferred to communicate intent to perform day-level comparison, as well as for\ngeneral readability.*/define function \"ToDateInterval\"(period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "34"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "35"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "Interval["
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "date from "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "start of "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "36"
                                                                    }
                                                                ],
                                                                "node_type" : "Start",
                                                                "ref_id" : "37"
                                                            }
                                                        ],
                                                        "ref_id" : "38"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ", "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "date from "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "end of "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "39"
                                                                    }
                                                                ],
                                                                "node_type" : "End",
                                                                "ref_id" : "40"
                                                            }
                                                        ],
                                                        "ref_id" : "41"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "]"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "Interval",
                                                "ref_id" : "42"
                                            }
                                        ],
                                        "node_type" : "Interval",
                                        "ref_id" : "42"
                                    }
                                ],
                                "ref_id" : "43"
                            }
                        ],
                        "define_name" : "ToDateInterval"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*returns list of all locations within an encounter, including locations for immediately prior ED visit.*/define function \"HospitalizationLocations\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "47"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Encounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "48"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " Visit"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "49"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "let "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "EDVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Emergency Department Visit\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "50"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "50"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastED"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "51"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastED"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "52"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "53"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "53"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "57"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "58"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "Visit"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "54"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Property",
                                                                                                                        "ref_id" : "55"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "55"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "56"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "58"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "58"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "59"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "60"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "61"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "62"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "63"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "64"
                                                                    }
                                                                ],
                                                                "ref_id" : "65"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "return "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "if "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "EDVisit"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "66"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " is null"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "67"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " then "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Visit"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "68"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "."
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "facilityLocations"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "69"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "69"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " \n      else "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "flatten "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "{ "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EDVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "70"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "facilityLocations"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "71"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "71"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ", "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Visit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "72"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "facilityLocations"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "73"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "73"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " }"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "List",
                                                                                "ref_id" : "74"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "75"
                                                                    }
                                                                ],
                                                                "node_type" : "If",
                                                                "ref_id" : "76"
                                                            }
                                                        ],
                                                        "ref_id" : "77"
                                                    }
                                                ],
                                                "node_type" : "Query",
                                                "ref_id" : "78"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "78"
                                    }
                                ],
                                "ref_id" : "79"
                            }
                        ],
                        "define_name" : "HospitalizationLocations"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Returns the arrival time in the ED for the encounter.*/define function \"EmergencyDepartmentArrivalTime\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "80"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "start of "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "First("
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "("
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"HospitalizationLocations\"("
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "Encounter"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "OperandRef",
                                                                                                                "ref_id" : "81"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : ")"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "FunctionRef",
                                                                                                        "ref_id" : "82"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ")"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "FunctionRef",
                                                                                                "ref_id" : "82"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "HospitalLocation"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "83"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "where "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "HospitalLocation"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "84"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "."
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "code"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "85"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "85"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : " in "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "\"Emergency Department Visit\""
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "86"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "87"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "87"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "sort by "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "locationPeriod"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "IdentifierRef",
                                                                                                        "ref_id" : "88"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "89"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "90"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "91"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "92"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "93"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "locationPeriod"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "94"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "94"
                                                    }
                                                ],
                                                "node_type" : "Start",
                                                "ref_id" : "95"
                                            }
                                        ],
                                        "node_type" : "Start",
                                        "ref_id" : "95"
                                    }
                                ],
                                "ref_id" : "96"
                            }
                        ],
                        "define_name" : "EmergencyDepartmentArrivalTime"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.*/define function \"Hospitalization\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "99"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Encounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "100"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " Visit"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "101"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "let "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "EDVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Emergency Department Visit\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "102"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "102"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastED"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "103"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastED"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "104"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "105"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "105"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "109"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "110"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "Visit"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "106"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Property",
                                                                                                                        "ref_id" : "107"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "107"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "108"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "110"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "110"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "111"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "112"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "113"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "114"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "115"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "116"
                                                                    }
                                                                ],
                                                                "ref_id" : "117"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "return "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Interval["
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Coalesce("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EDVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "118"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "119"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "119"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "120"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Visit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "121"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "122"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "122"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "123"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "124"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ", \n    "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "end of "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Visit"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "125"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "126"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "126"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "127"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "]"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Interval",
                                                                "ref_id" : "128"
                                                            }
                                                        ],
                                                        "ref_id" : "129"
                                                    }
                                                ],
                                                "node_type" : "Query",
                                                "ref_id" : "130"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "130"
                                    }
                                ],
                                "ref_id" : "131"
                            }
                        ],
                        "define_name" : "Hospitalization"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Returns admission time for an encounter or for immediately prior emergency department visit.*/define function \"HospitalAdmissionTime\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "97"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "start of "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\"Hospitalization\"("
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "98"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "FunctionRef",
                                                        "ref_id" : "132"
                                                    }
                                                ],
                                                "node_type" : "Start",
                                                "ref_id" : "133"
                                            }
                                        ],
                                        "node_type" : "Start",
                                        "ref_id" : "133"
                                    }
                                ],
                                "ref_id" : "134"
                            }
                        ],
                        "define_name" : "HospitalAdmissionTime"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Returns earliest arrival time for an encounter including any prior ED visit.*/define function \"HospitalArrivalTime\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "135"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "start of "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "First("
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "("
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"HospitalizationLocations\"("
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "Encounter"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "OperandRef",
                                                                                                                "ref_id" : "136"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : ")"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "FunctionRef",
                                                                                                        "ref_id" : "137"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ")"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "FunctionRef",
                                                                                                "ref_id" : "137"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "HospitalLocation"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "138"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "sort by "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "locationPeriod"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "IdentifierRef",
                                                                                                        "ref_id" : "139"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "140"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "141"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "142"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "143"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "144"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "locationPeriod"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "145"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "145"
                                                    }
                                                ],
                                                "node_type" : "Start",
                                                "ref_id" : "146"
                                            }
                                        ],
                                        "node_type" : "Start",
                                        "ref_id" : "146"
                                    }
                                ],
                                "ref_id" : "147"
                            }
                        ],
                        "define_name" : "HospitalArrivalTime"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter*/define function \"HospitalizationLengthofStay\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "150"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "LengthInDays("
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\"Hospitalization\"("
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "151"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "FunctionRef",
                                                        "ref_id" : "152"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ")"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "FunctionRef",
                                                "ref_id" : "153"
                                            }
                                        ],
                                        "node_type" : "FunctionRef",
                                        "ref_id" : "153"
                                    }
                                ],
                                "ref_id" : "154"
                            }
                        ],
                        "define_name" : "HospitalizationLengthofStay"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Returns the latest departure time for encounter including any prior ED visit.*/define function \"HospitalDepartureTime\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "155"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "end of "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Last("
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "("
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "\"HospitalizationLocations\"("
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "Encounter"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "OperandRef",
                                                                                                                "ref_id" : "156"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : ")"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "FunctionRef",
                                                                                                        "ref_id" : "157"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : ")"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "FunctionRef",
                                                                                                "ref_id" : "157"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "HospitalLocation"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "158"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n      "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "sort by "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "start of "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "locationPeriod"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "IdentifierRef",
                                                                                                        "ref_id" : "159"
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Start",
                                                                                                "ref_id" : "160"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "161"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "162"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "163"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n  )"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "164"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "locationPeriod"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "165"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "165"
                                                    }
                                                ],
                                                "node_type" : "End",
                                                "ref_id" : "166"
                                            }
                                        ],
                                        "node_type" : "End",
                                        "ref_id" : "166"
                                    }
                                ],
                                "ref_id" : "167"
                            }
                        ],
                        "define_name" : "HospitalDepartureTime"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Hospital Discharge Time returns the discharge time for an encounter*/define function \"HospitalDischargeTime\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "168"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "end of "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "169"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "."
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "relevantPeriod"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Property",
                                                                "ref_id" : "170"
                                                            }
                                                        ],
                                                        "node_type" : "Property",
                                                        "ref_id" : "170"
                                                    }
                                                ],
                                                "node_type" : "End",
                                                "ref_id" : "171"
                                            }
                                        ],
                                        "node_type" : "End",
                                        "ref_id" : "171"
                                    }
                                ],
                                "ref_id" : "172"
                            }
                        ],
                        "define_name" : "HospitalDischargeTime"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.*/define function \"HospitalizationWithObservationAndOutpatientSurgeryService\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "173"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Encounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "174"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " Visit"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "175"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "let "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "ObsVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Observation Services\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "176"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "176"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastObs"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "177"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastObs"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "178"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "179"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "179"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "183"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "184"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "Visit"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "180"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Property",
                                                                                                                        "ref_id" : "181"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "181"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "182"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "184"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "184"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "185"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "186"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "187"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "188"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "189"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "190"
                                                                    }
                                                                ],
                                                                "ref_id" : "191"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "VisitStart: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Coalesce("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "ObsVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "192"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "193"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "193"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "194"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Visit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "195"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "196"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "196"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "197"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Coalesce",
                                                                        "ref_id" : "198"
                                                                    }
                                                                ],
                                                                "ref_id" : "199"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "EDVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Emergency Department Visit\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "200"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "200"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastED"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "201"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastED"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "202"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "203"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "203"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "205"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "206"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "VisitStart"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "QueryLetRef",
                                                                                                        "ref_id" : "204"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "206"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "206"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "207"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "208"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "209"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "210"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "211"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "212"
                                                                    }
                                                                ],
                                                                "ref_id" : "213"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "VisitStartWithED: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Coalesce("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EDVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "214"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "215"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "215"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "216"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "VisitStart"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "217"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Coalesce",
                                                                        "ref_id" : "218"
                                                                    }
                                                                ],
                                                                "ref_id" : "219"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "OutpatientSurgeryVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Outpatient Surgery Service\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "220"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "220"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastSurgeryOP"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "221"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastSurgeryOP"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "222"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "223"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "223"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "225"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "226"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "VisitStartWithED"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "QueryLetRef",
                                                                                                        "ref_id" : "224"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "226"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "226"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "227"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "228"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "229"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "230"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "231"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "232"
                                                                    }
                                                                ],
                                                                "ref_id" : "233"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "return "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Interval["
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Coalesce("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "OutpatientSurgeryVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "234"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "235"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "235"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "236"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "VisitStartWithED"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "237"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "238"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ", \n    "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "end of "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Visit"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "239"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "240"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "240"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "241"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "]"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Interval",
                                                                "ref_id" : "242"
                                                            }
                                                        ],
                                                        "ref_id" : "243"
                                                    }
                                                ],
                                                "node_type" : "Query",
                                                "ref_id" : "244"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "244"
                                    }
                                ],
                                "ref_id" : "245"
                            }
                        ],
                        "define_name" : "HospitalizationWithObservationAndOutpatientSurgeryService"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*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 function \"HospitalizationWithObservation\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "246"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "Encounter"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "247"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " Visit"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "248"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "let "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "ObsVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Observation Services\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "249"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "249"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastObs"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "250"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastObs"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "251"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "252"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "252"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "256"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "257"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "start of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "Visit"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "ref_id" : "253"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "."
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "relevantPeriod"
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ],
                                                                                                                        "node_type" : "Property",
                                                                                                                        "ref_id" : "254"
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "254"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Start",
                                                                                                        "ref_id" : "255"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "257"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "257"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "258"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "259"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "260"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "261"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "262"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "263"
                                                                    }
                                                                ],
                                                                "ref_id" : "264"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "VisitStart: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Coalesce("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "ObsVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "265"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "266"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "266"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "267"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Visit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "268"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "269"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "269"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "270"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Coalesce",
                                                                        "ref_id" : "271"
                                                                    }
                                                                ],
                                                                "ref_id" : "272"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ",\n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "EDVisit: "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Last("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "[\"Encounter, Performed\": "
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "children" : [
                                                                                                                                    {
                                                                                                                                        "text" : "\"Emergency Department Visit\""
                                                                                                                                    }
                                                                                                                                ]
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "]"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Retrieve",
                                                                                                                "ref_id" : "273"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Retrieve",
                                                                                                        "ref_id" : "273"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " LastED"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "274"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "where "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "LastED"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "ref_id" : "275"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "."
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Property",
                                                                                                                "ref_id" : "276"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "Property",
                                                                                                        "ref_id" : "276"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "ends "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "1 hour"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "Quantity",
                                                                                                                "ref_id" : "278"
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : " or less on or before"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "ref_id" : "279"
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : " "
                                                                                                            }
                                                                                                        ]
                                                                                                    },
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "VisitStart"
                                                                                                                    }
                                                                                                                ]
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "QueryLetRef",
                                                                                                        "ref_id" : "277"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "279"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "279"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "\n        "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "sort by \n        "
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "text" : "end of "
                                                                                                                    }
                                                                                                                ]
                                                                                                            },
                                                                                                            {
                                                                                                                "children" : [
                                                                                                                    {
                                                                                                                        "children" : [
                                                                                                                            {
                                                                                                                                "text" : "relevantPeriod"
                                                                                                                            }
                                                                                                                        ]
                                                                                                                    }
                                                                                                                ],
                                                                                                                "node_type" : "IdentifierRef",
                                                                                                                "ref_id" : "280"
                                                                                                            }
                                                                                                        ],
                                                                                                        "node_type" : "End",
                                                                                                        "ref_id" : "281"
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "282"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "283"
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "284"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n    )"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "Last",
                                                                        "ref_id" : "285"
                                                                    }
                                                                ],
                                                                "ref_id" : "286"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "return "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Interval["
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Coalesce("
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "EDVisit"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "287"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "288"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "288"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "289"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ", "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "VisitStart"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "QueryLetRef",
                                                                                "ref_id" : "290"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ")"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "291"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ", \n    "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "end of "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "Visit"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "292"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "."
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "relevantPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "293"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "293"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "294"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "]"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "Interval",
                                                                "ref_id" : "295"
                                                            }
                                                        ],
                                                        "ref_id" : "296"
                                                    }
                                                ],
                                                "node_type" : "Query",
                                                "ref_id" : "297"
                                            }
                                        ],
                                        "node_type" : "Query",
                                        "ref_id" : "297"
                                    }
                                ],
                                "ref_id" : "298"
                            }
                        ],
                        "define_name" : "HospitalizationWithObservation"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Hospitalization with Observation Length of Stay returns the length in days from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter*/define function \"HospitalizationWithObservationLengthofStay\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "299"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\"LengthInDays\"("
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\"HospitalizationWithObservation\"("
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "Encounter"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "300"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "FunctionRef",
                                                        "ref_id" : "301"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ")"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "FunctionRef",
                                                "ref_id" : "302"
                                            }
                                        ],
                                        "node_type" : "FunctionRef",
                                        "ref_id" : "302"
                                    }
                                ],
                                "ref_id" : "303"
                            }
                        ],
                        "define_name" : "HospitalizationWithObservationLengthofStay"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*First Inpatient Intensive Care Unit returns the first intensive care unit for the given encounter, without considering any immediately prior emergency department visit.*/define function \"FirstInpatientIntensiveCareUnit\"(Encounter "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "\"Encounter, Performed\""
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "304"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "First("
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "("
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Encounter"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "305"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "facilityLocations"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "306"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "306"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : ")"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Property",
                                                                                "ref_id" : "306"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "HospitalLocation"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "307"
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "where "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "HospitalLocation"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "308"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "code"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "309"
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "309"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " in "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "\"Intensive Care Unit\""
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "310"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "InValueSet",
                                                                                "ref_id" : "311"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "\n        and "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "HospitalLocation"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "312"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "locationPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "313"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "313"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : " during "
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "IncludedIn",
                                                                                        "ref_id" : "316"
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "Encounter"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "ref_id" : "314"
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "."
                                                                                                    }
                                                                                                ]
                                                                                            },
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "children" : [
                                                                                                            {
                                                                                                                "text" : "relevantPeriod"
                                                                                                            }
                                                                                                        ]
                                                                                                    }
                                                                                                ],
                                                                                                "node_type" : "Property",
                                                                                                "ref_id" : "315"
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "Property",
                                                                                        "ref_id" : "315"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "IncludedIn",
                                                                                "ref_id" : "316"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "317"
                                                                    }
                                                                ],
                                                                "ref_id" : "317"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n      "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "sort by "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "locationPeriod"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "IdentifierRef",
                                                                                        "ref_id" : "318"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "319"
                                                                            }
                                                                        ],
                                                                        "ref_id" : "320"
                                                                    }
                                                                ],
                                                                "ref_id" : "321"
                                                            }
                                                        ],
                                                        "ref_id" : "322"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n  )"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "First",
                                                "ref_id" : "323"
                                            }
                                        ],
                                        "node_type" : "First",
                                        "ref_id" : "323"
                                    }
                                ],
                                "ref_id" : "324"
                            }
                        ],
                        "define_name" : "FirstInpatientIntensiveCareUnit"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Given a datetime and a period, returns the period (if a period is provided) or the interval beginning and ending on the datetime (if a datetime is provided)*/define function \"NormalizeInterval\"(pointInTime "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "DateTime"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "325"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : ", period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "326"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "327"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "if "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "pointInTime"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "328"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " is not null"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "329"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " then "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "Interval["
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "pointInTime"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "330"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ", "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "pointInTime"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "331"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "]"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "332"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "\n    else "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "if "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "333"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : " is not null"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "334"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " then "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "335"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : " \n    else "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "null as "
                                                                            }
                                                                        ],
                                                                        "node_type" : "Null",
                                                                        "ref_id" : "336"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "Interval<"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "DateTime"
                                                                                            }
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "ref_id" : "337"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : ">"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "ref_id" : "338"
                                                                    }
                                                                ],
                                                                "ref_id" : "339"
                                                            }
                                                        ],
                                                        "ref_id" : "340"
                                                    }
                                                ],
                                                "node_type" : "If",
                                                "ref_id" : "341"
                                            }
                                        ],
                                        "node_type" : "If",
                                        "ref_id" : "341"
                                    }
                                ],
                                "ref_id" : "342"
                            }
                        ],
                        "define_name" : "NormalizeInterval"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*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 function \"HasStart\"(period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "343"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "344"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "not "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "( "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "345"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "346"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " is null"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "IsNull",
                                                                        "ref_id" : "347"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n      or "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "start of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "348"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "Start",
                                                                                "ref_id" : "349"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " = "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "minimum "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "DateTime"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "350"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "MinValue",
                                                                                "ref_id" : "351"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Equal",
                                                                        "ref_id" : "352"
                                                                    }
                                                                ],
                                                                "node_type" : "Or",
                                                                "ref_id" : "353"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n  )"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "Or",
                                                        "ref_id" : "353"
                                                    }
                                                ],
                                                "node_type" : "Not",
                                                "ref_id" : "354"
                                            }
                                        ],
                                        "node_type" : "Not",
                                        "ref_id" : "354"
                                    }
                                ],
                                "ref_id" : "355"
                            }
                        ],
                        "define_name" : "HasStart"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Given an interval, return true if the interval has an ending boundary specified (i.e. the end of the interval is not null and not the maximum DateTime value)*/define function \"HasEnd\"(period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "356"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "357"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "not "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "( \n    "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "end of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "358"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "End",
                                                                                "ref_id" : "359"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " is null"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "IsNull",
                                                                        "ref_id" : "360"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "\n      or \n      "
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "end of "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "period"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "node_type" : "OperandRef",
                                                                                        "ref_id" : "361"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "End",
                                                                                "ref_id" : "362"
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : " = "
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "text" : "maximum "
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "children" : [
                                                                                            {
                                                                                                "children" : [
                                                                                                    {
                                                                                                        "text" : "DateTime"
                                                                                                    }
                                                                                                ]
                                                                                            }
                                                                                        ],
                                                                                        "ref_id" : "363"
                                                                                    }
                                                                                ],
                                                                                "node_type" : "MaxValue",
                                                                                "ref_id" : "364"
                                                                            }
                                                                        ],
                                                                        "node_type" : "Equal",
                                                                        "ref_id" : "365"
                                                                    }
                                                                ],
                                                                "node_type" : "Or",
                                                                "ref_id" : "366"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "\n  )"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "Or",
                                                        "ref_id" : "366"
                                                    }
                                                ],
                                                "node_type" : "Not",
                                                "ref_id" : "367"
                                            }
                                        ],
                                        "node_type" : "Not",
                                        "ref_id" : "367"
                                    }
                                ],
                                "ref_id" : "368"
                            }
                        ],
                        "define_name" : "HasEnd"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Given an interval, return the ending point if the interval has an ending boundary specified, otherwise, return the starting point*/define function \"Latest\"(period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "369"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "370"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "if "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "( "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "HasEnd("
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "371"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ")"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "372"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "372"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " then \n  "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "end of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "373"
                                                            }
                                                        ],
                                                        "ref_id" : "374"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " \n    else "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "start of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "375"
                                                            }
                                                        ],
                                                        "ref_id" : "376"
                                                    }
                                                ],
                                                "node_type" : "If",
                                                "ref_id" : "377"
                                            }
                                        ],
                                        "node_type" : "If",
                                        "ref_id" : "377"
                                    }
                                ],
                                "ref_id" : "378"
                            }
                        ],
                        "define_name" : "Latest"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Given an interval, return the starting point if the interval has a starting boundary specified, otherwise, return the ending point*/define function \"Earliest\"(period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "379"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "380"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "if "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "( "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "HasStart("
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "children" : [
                                                                                    {
                                                                                        "text" : "period"
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ],
                                                                        "node_type" : "OperandRef",
                                                                        "ref_id" : "381"
                                                                    },
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : ")"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "ref_id" : "382"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "ref_id" : "382"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " then "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "start of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "383"
                                                            }
                                                        ],
                                                        "ref_id" : "384"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : " \n    else \n  "
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "end of "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "385"
                                                            }
                                                        ],
                                                        "ref_id" : "386"
                                                    }
                                                ],
                                                "node_type" : "If",
                                                "ref_id" : "387"
                                            }
                                        ],
                                        "node_type" : "If",
                                        "ref_id" : "387"
                                    }
                                ],
                                "ref_id" : "388"
                            }
                        ],
                        "define_name" : "Earliest"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Given a pointInTime or period, if the pointInTime is specified, returns the pointInTime, returns the ending point of the period if the period has an ending boundary specified, otherwise returns the starting point of the interval*/define function \"LatestOf\"(pointInTime "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "DateTime"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "389"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : ", period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "390"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "391"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "Latest("
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "NormalizeInterval("
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "pointInTime"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "392"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ", "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "393"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "FunctionRef",
                                                        "ref_id" : "394"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ")"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "FunctionRef",
                                                "ref_id" : "395"
                                            }
                                        ],
                                        "node_type" : "FunctionRef",
                                        "ref_id" : "395"
                                    }
                                ],
                                "ref_id" : "396"
                            }
                        ],
                        "define_name" : "LatestOf"
                    },
                    {
                        "children" : [
                            {
                                "children" : [
                                    {
                                        "children" : [
                                            {
                                                "text" : "/*Given a pointInTime or period, if the pointInTime is specified, returns the pointInTime, returns the starting point of the period if the period has a starting boundary specified, otherwise returns the ending point of the period*/define function \"EarliestOf\"(pointInTime "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "DateTime"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "397"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : ", period "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "text" : "Interval<"
                                                    }
                                                ]
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "DateTime"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "ref_id" : "398"
                                            },
                                            {
                                                "children" : [
                                                    {
                                                        "text" : ">"
                                                    }
                                                ]
                                            }
                                        ],
                                        "ref_id" : "399"
                                    },
                                    {
                                        "children" : [
                                            {
                                                "text" : " ):\n  "
                                            }
                                        ]
                                    },
                                    {
                                        "children" : [
                                            {
                                                "children" : [
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : "Earliest("
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : "NormalizeInterval("
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "pointInTime"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "400"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ", "
                                                                    }
                                                                ]
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "children" : [
                                                                            {
                                                                                "text" : "period"
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "node_type" : "OperandRef",
                                                                "ref_id" : "401"
                                                            },
                                                            {
                                                                "children" : [
                                                                    {
                                                                        "text" : ")"
                                                                    }
                                                                ]
                                                            }
                                                        ],
                                                        "node_type" : "FunctionRef",
                                                        "ref_id" : "402"
                                                    },
                                                    {
                                                        "children" : [
                                                            {
                                                                "text" : ")"
                                                            }
                                                        ]
                                                    }
                                                ],
                                                "node_type" : "FunctionRef",
                                                "ref_id" : "403"
                                            }
                                        ],
                                        "node_type" : "FunctionRef",
                                        "ref_id" : "403"
                                    }
                                ],
                                "ref_id" : "404"
                            }
                        ],
                        "define_name" : "EarliestOf"
                    }
                ],
                "identifier" : {
                    "id" : "MATGlobalCommonFunctions",
                    "version" : "7.0.000"
                }
            },
            "is_main_library" : false,
            "statement_dependencies" : [
                {
                    "_id" : "64232952f9a010eeafc2a09b",
                    "statement_name" : "HospitalizationWithObservation"
                },
                {
                    "_id" : "64232952f9a010eeafc2a09c",
                    "statement_name" : "NormalizeInterval"
                },
                {
                    "_id" : "64232952f9a010eeafc2a09d",
                    "statement_name" : "EarliestOf",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a09e",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "Earliest"
                        },
                        {
                            "_id" : "64232952f9a010eeafc2a09f",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "NormalizeInterval"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a0a0",
                    "statement_name" : "Earliest",
                    "statement_references" : [
                        {
                            "_id" : "64232952f9a010eeafc2a0a1",
                            "library_name" : "MATGlobalCommonFunctions",
                            "statement_name" : "HasStart"
                        }
                    ]
                },
                {
                    "_id" : "64232952f9a010eeafc2a0a2",
                    "statement_name" : "HasStart"
                }
            ]
        }
    ],
    "source_data_criteria" : [
        {
            "_id" : "64232952f9a010eeafc2a0a3",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::EncounterPerformed",
            "facilityLocations" : [

            ],
            "qdmTitle" : "Encounter, Performed",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.5",
            "qdmCategory" : "encounter",
            "qdmStatus" : "performed",
            "qdmVersion" : "5.6",
            "description" : "Encounter, Performed: EncounterInpatient",
            "codeListId" : "2.16.840.1.113883.3.666.5.307"
        },
        {
            "_id" : "64232952f9a010eeafc2a0a4",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::PatientCharacteristicPayer",
            "qdmTitle" : "Patient Characteristic Payer",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.58",
            "qdmCategory" : "patient_characteristic",
            "qdmStatus" : "payer",
            "qdmVersion" : "5.6",
            "description" : "Patient Characteristic Payer: Payer",
            "codeListId" : "2.16.840.1.114222.4.11.3591"
        },
        {
            "_id" : "64232952f9a010eeafc2a0a5",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::PatientCharacteristicSex",
            "qdmTitle" : "Patient Characteristic Sex",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.55",
            "qdmCategory" : "patient_characteristic",
            "qdmStatus" : "gender",
            "qdmVersion" : "5.6",
            "description" : "Patient Characteristic Sex: ONCAdministrativeSex",
            "codeListId" : "2.16.840.1.113762.1.4.1"
        },
        {
            "_id" : "64232952f9a010eeafc2a0a6",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::PatientCharacteristicEthnicity",
            "qdmTitle" : "Patient Characteristic Ethnicity",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.56",
            "qdmCategory" : "patient_characteristic",
            "qdmStatus" : "ethnicity",
            "qdmVersion" : "5.6",
            "description" : "Patient Characteristic Ethnicity: Ethnicity",
            "codeListId" : "2.16.840.1.114222.4.11.837"
        },
        {
            "_id" : "64232952f9a010eeafc2a0a7",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::LaboratoryTestPerformed",
            "qdmTitle" : "Laboratory Test, Performed",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.42",
            "qdmCategory" : "laboratory_test",
            "qdmStatus" : "performed",
            "qdmVersion" : "5.6",
            "description" : "Laboratory Test, Performed: GlucoseLabTestMassPerVolume",
            "codeListId" : "2.16.840.1.113762.1.4.1248.34"
        },
        {
            "_id" : "64232952f9a010eeafc2a0a8",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::EncounterPerformed",
            "facilityLocations" : [

            ],
            "qdmTitle" : "Encounter, Performed",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.5",
            "qdmCategory" : "encounter",
            "qdmStatus" : "performed",
            "qdmVersion" : "5.6",
            "description" : "Encounter, Performed: ObservationServices",
            "codeListId" : "2.16.840.1.113762.1.4.1111.143"
        },
        {
            "_id" : "64232952f9a010eeafc2a0a9",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::PatientCharacteristicRace",
            "qdmTitle" : "Patient Characteristic Race",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.59",
            "qdmCategory" : "patient_characteristic",
            "qdmStatus" : "race",
            "qdmVersion" : "5.6",
            "description" : "Patient Characteristic Race: Race",
            "codeListId" : "2.16.840.1.114222.4.11.836"
        },
        {
            "_id" : "64232952f9a010eeafc2a0aa",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::EncounterPerformed",
            "facilityLocations" : [

            ],
            "qdmTitle" : "Encounter, Performed",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.5",
            "qdmCategory" : "encounter",
            "qdmStatus" : "performed",
            "qdmVersion" : "5.6",
            "description" : "Encounter, Performed: EmergencyDepartmentVisit",
            "codeListId" : "2.16.840.1.113883.3.117.1.7.1.292"
        },
        {
            "_id" : "64232952f9a010eeafc2a0ab",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::Diagnosis",
            "qdmTitle" : "Diagnosis",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.110",
            "qrdaOid" : "2.16.840.1.113883.10.20.24.3.135",
            "qdmCategory" : "condition",
            "qdmVersion" : "5.6",
            "description" : "Diagnosis: Diabetes",
            "codeListId" : "2.16.840.1.113883.3.464.1003.103.12.1001"
        },
        {
            "_id" : "64232952f9a010eeafc2a0ac",
            "dataElementCodes" : [

            ],
            "_type" : "QDM::MedicationAdministered",
            "qdmTitle" : "Medication, Administered",
            "hqmfOid" : "2.16.840.1.113883.10.20.28.4.45",
            "qdmCategory" : "medication",
            "qdmStatus" : "administered",
            "qdmVersion" : "5.6",
            "description" : "Medication, Administered: HypoglycemicsTreatmentMedications",
            "codeListId" : "2.16.840.1.113762.1.4.1196.394"
        }
    ],
    "population_sets" : [
        {
            "_id" : "64232952f9a010eeafc2a0ad",
            "title" : "Population Criteria Section",
            "population_set_id" : "PopulationSet_1",
            "populations" : {
                "_id" : "64232952f9a010eeafc2a0ae",
                "_type" : "CQM::RatioPopulationMap",
                "IPP" : {
                    "_id" : "64232952f9a010eeafc2a0af",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "Initial Population",
                    "hqmf_id" : "18CA6DFD-F20D-452D-9F10-80908239437A"
                },
                "DENOM" : {
                    "_id" : "64232952f9a010eeafc2a0b0",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "Denominator",
                    "hqmf_id" : "5E387CCD-AB40-48EB-984E-BB88A74FA84A"
                },
                "DENEX" : {
                    "_id" : "64232952f9a010eeafc2a0b1",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "Denominator Exclusions",
                    "hqmf_id" : "B8D56145-B6E6-4A25-8D30-A7D1F18F0587"
                },
                "NUMER" : {
                    "_id" : "64232952f9a010eeafc2a0b2",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "Numerator",
                    "hqmf_id" : "B24F213F-485F-4C15-A644-B22AFA73C495"
                }
            },
            "supplemental_data_elements" : [
                {
                    "_id" : "64232952f9a010eeafc2a0b3",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "SDE Ethnicity",
                    "hqmf_id" : "A56390B3-9271-4ACD-90BE-74AD48F2F749"
                },
                {
                    "_id" : "64232952f9a010eeafc2a0b4",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "SDE Payer",
                    "hqmf_id" : "FD1F8E00-7A5F-4A0B-BBEB-62FFD10109B4"
                },
                {
                    "_id" : "64232952f9a010eeafc2a0b5",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "SDE Race",
                    "hqmf_id" : "16F05193-FD30-4759-8F38-C6EE0845C2D5"
                },
                {
                    "_id" : "64232952f9a010eeafc2a0b6",
                    "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                    "statement_name" : "SDE Sex",
                    "hqmf_id" : "A64A1E43-5412-45D5-B71B-21E606DDD0D5"
                }
            ],
            "observations" : [
                {
                    "_id" : "64232952f9a010eeafc2a0b7",
                    "hqmf_id" : "EF3028E4-3A9C-4E0C-9519-4F882EF18C0C",
                    "aggregation_type" : "SUM",
                    "observation_function" : {
                        "_id" : "64232952f9a010eeafc2a0b8",
                        "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                        "statement_name" : "Denominator Observations",
                        "hqmf_id" : "EF3028E4-3A9C-4E0C-9519-4F882EF18C0C"
                    },
                    "observation_parameter" : {
                        "_id" : "64232952f9a010eeafc2a0b9",
                        "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                        "statement_name" : "Denominator",
                        "hqmf_id" : "EF3028E4-3A9C-4E0C-9519-4F882EF18C0C"
                    }
                },
                {
                    "_id" : "64232952f9a010eeafc2a0ba",
                    "hqmf_id" : "BADA053C-ACB6-4863-8238-F4FADEC14550",
                    "aggregation_type" : "SUM",
                    "observation_function" : {
                        "_id" : "64232952f9a010eeafc2a0bb",
                        "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                        "statement_name" : "Numerator Observations",
                        "hqmf_id" : "BADA053C-ACB6-4863-8238-F4FADEC14550"
                    },
                    "observation_parameter" : {
                        "_id" : "64232952f9a010eeafc2a0bc",
                        "library_name" : "HospitalHarmHyperglycemiainHospitalizedPatients",
                        "statement_name" : "Numerator",
                        "hqmf_id" : "BADA053C-ACB6-4863-8238-F4FADEC14550"
                    }
                }
            ]
        }
    ]
}