{
  "calculate_sdes": null,
  "calculation_method": "PATIENT",
  "cms_id": "CMS137v7",
  "component": false,
  "component_hqmf_set_ids": [

  ],
  "composite": false,
  "composite_hqmf_set_id": null,
  "cql_libraries": [
    {
      "cql": "library InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment version '7.2.000'\r\n\r\nusing QDM version '5.3'\r\n\r\ninclude Hospice version '1.0.000' called Hospice\r\ninclude MATGlobalCommonFunctions version '2.0.000' called Global\r\n\r\nvalueset \"ONC Administrative Sex\": 'urn:oid:2.16.840.1.113762.1.4.1'\r\nvalueset \"Race\": 'urn:oid:2.16.840.1.114222.4.11.836'\r\nvalueset \"Ethnicity\": 'urn:oid:2.16.840.1.114222.4.11.837'\r\nvalueset \"Payer\": 'urn:oid:2.16.840.1.114222.4.11.3591'\r\nvalueset \"Alcohol and Drug Dependence\": 'urn:oid:2.16.840.1.113883.3.464.1003.106.12.1001'\r\nvalueset \"Alcohol and Drug Dependence Treatment\": 'urn:oid:2.16.840.1.113883.3.464.1003.106.12.1005'\r\nvalueset \"Detoxification Visit\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1059'\r\nvalueset \"Discharge Services - Hospital Inpatient\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1007'\r\nvalueset \"Discharge Services - Hospital Inpatient Same Day Discharge\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1006'\r\nvalueset \"Emergency Department Visit\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1010'\r\nvalueset \"Hospital Inpatient Visit - Initial\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1004'\r\nvalueset \"Hospital Observation Care - Initial\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1002'\r\nvalueset \"Office Visit\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1001'\r\nvalueset \"Psych Visit - Psychotherapy\": 'urn:oid:2.16.840.1.113883.3.526.3.1496'\r\n\r\nparameter \"Measurement Period\" Interval<DateTime>\r\n\r\ncontext Patient\r\n\r\ndefine \"SDE Ethnicity\":\r\n\t[\"Patient Characteristic Ethnicity\": \"Ethnicity\"]\r\n\r\ndefine \"SDE Payer\":\r\n\t[\"Patient Characteristic Payer\": \"Payer\"]\r\n\r\ndefine \"SDE Race\":\r\n\t[\"Patient Characteristic Race\": \"Race\"]\r\n\r\ndefine \"SDE Sex\":\r\n\t[\"Patient Characteristic Sex\": \"ONC Administrative Sex\"]\r\n\r\ndefine \"Denominator\":\r\n\t\"Initial Population\"\r\n\r\ndefine \"Numerator 2\":\r\n\t\"Has Continuation Of Treatments\"\r\n\r\ndefine \"Stratification 2\":\r\n\texists ( [\"Patient Characteristic Birthdate\"] BirthDate\r\n\t\t\twhere Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")>= 18\r\n\t)\r\n\r\ndefine \"Qualifying Encounters\":\r\n\t( [\"Encounter, Performed\": \"Office Visit\"]\r\n\t\tunion [\"Encounter, Performed\": \"Emergency Department Visit\"]\r\n\t\tunion [\"Encounter, Performed\": \"Detoxification Visit\"]\r\n\t\tunion [\"Encounter, Performed\": \"Hospital Observation Care - Initial\"]\r\n\t\tunion [\"Encounter, Performed\": \"Hospital Inpatient Visit - Initial\"]\r\n\t\tunion [\"Encounter, Performed\": \"Discharge Services - Hospital Inpatient Same Day Discharge\"]\r\n\t\tunion [\"Encounter, Performed\": \"Discharge Services - Hospital Inpatient\"] ) ValidEncounters\r\n\t\twhere ValidEncounters.relevantPeriod during \"Measurement Period\"\r\n\r\ndefine \"First Dependence Diagnosis\":\r\n\tFirst([\"Diagnosis\": \"Alcohol and Drug Dependence\"] InitialDependenceDiagnosis\r\n\t\t\twith(\"Qualifying Encounters\")ValidEncounter\r\n\t\t\t\tsuch that InitialDependenceDiagnosis.prevalencePeriod starts during ValidEncounter.relevantPeriod\r\n\t\t\t\t\tand InitialDependenceDiagnosis.prevalencePeriod starts 319 days or less after start of \"Measurement Period\"\r\n\t\t\tsort by start of prevalencePeriod\r\n\t)\r\n\r\ndefine \"Treatment Initiation\":\r\n\t( ( [\"Encounter, Performed\": \"Alcohol and Drug Dependence Treatment\"]\r\n\t\t\tunion [\"Encounter, Performed\": \"Psych Visit - Psychotherapy\"] ) InitiatedTreatment\r\n\t\t\twith ( \"First Dependence Diagnosis\" ) FirstDiagnosed\r\n\t\t\t\tsuch that InitiatedTreatment.relevantPeriod starts 14 days or less after day of start of FirstDiagnosed.prevalencePeriod\r\n\t)\r\n\r\ndefine \"Stratification 1\":\r\n\texists ( [\"Patient Characteristic Birthdate\"] BirthDate\r\n\t\t\twhere Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")>= 13\r\n\t\t\t\tand Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")< 18\r\n\t)\r\n\r\ndefine \"Denominator Exclusions\":\r\n\tHospice.\"Has Hospice\"\r\n\t\tor exists \"Has Prior Dependence\"\r\n\r\ndefine \"Numerator\":\r\n\texists \"Treatment Initiation\"\r\n\r\ndefine \"Has Prior Dependence\":\r\n\t[\"Diagnosis\": \"Alcohol and Drug Dependence\"] PriorDependenceDiagnosis\r\n\t\twith ( \"First Dependence Diagnosis\" ) FirstDiagnosed\r\n\t\t\tsuch that PriorDependenceDiagnosis.prevalencePeriod starts 60 days or less before start of FirstDiagnosed.prevalencePeriod\r\n\r\ndefine \"Has Continuation Of Treatments\":\r\n\tCount(([\"Encounter, Performed\": \"Alcohol and Drug Dependence Treatment\"]\r\n\t\t\tunion [\"Encounter, Performed\": \"Psych Visit - Psychotherapy\"])ContinuedTreatment\r\n\t\t\twith(\"Treatment Initiation\")InitiatedTreatment\r\n\t\t\t\tsuch that ContinuedTreatment.relevantPeriod starts 30 days or less after start of InitiatedTreatment.relevantPeriod\r\n\t)>= 2\r\n\r\ndefine \"Initial Population\":\r\n\texists [\"Patient Characteristic Birthdate\"] BirthDate\r\n\t\twhere Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")>= 13\r\n\t\t\tand \"First Dependence Diagnosis\" is not null\r\n",
      "elm": {
        "library": {
          "identifier": {
            "id": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
            "version": "7.2.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_3",
                "version": "5.3"
              }
            ]
          },
          "includes": {
            "def": [
              {
                "localId": "2",
                "locator": "5:1-5:48",
                "localIdentifier": "Hospice",
                "path": "Hospice",
                "version": "1.0.000"
              },
              {
                "localId": "3",
                "locator": "7:1-7:64",
                "localIdentifier": "Global",
                "path": "MATGlobalCommonFunctions",
                "version": "2.0.000"
              }
            ]
          },
          "parameters": {
            "def": [
              {
                "localId": "20",
                "locator": "26:1-26:49",
                "name": "Measurement Period",
                "accessLevel": "Public",
                "parameterTypeSpecifier": {
                  "localId": "19",
                  "locator": "26:32-26:49",
                  "type": "IntervalTypeSpecifier",
                  "pointType": {
                    "localId": "18",
                    "locator": "26:41-26:48",
                    "name": "{urn:hl7-org:elm-types:r1}DateTime",
                    "type": "NamedTypeSpecifier"
                  }
                }
              }
            ]
          },
          "valueSets": {
            "def": [
              {
                "localId": "4",
                "locator": "10:1-10:68",
                "name": "ONC Administrative Sex",
                "id": "2.16.840.1.113762.1.4.1",
                "accessLevel": "Public"
              },
              {
                "localId": "5",
                "locator": "11:1-11:53",
                "name": "Race",
                "id": "2.16.840.1.114222.4.11.836",
                "accessLevel": "Public"
              },
              {
                "localId": "6",
                "locator": "12:1-12:58",
                "name": "Ethnicity",
                "id": "2.16.840.1.114222.4.11.837",
                "accessLevel": "Public"
              },
              {
                "localId": "7",
                "locator": "13:1-13:55",
                "name": "Payer",
                "id": "2.16.840.1.114222.4.11.3591",
                "accessLevel": "Public"
              },
              {
                "localId": "8",
                "locator": "14:1-14:90",
                "name": "Alcohol and Drug Dependence",
                "id": "2.16.840.1.113883.3.464.1003.106.12.1001",
                "accessLevel": "Public"
              },
              {
                "localId": "9",
                "locator": "15:1-15:100",
                "name": "Alcohol and Drug Dependence Treatment",
                "id": "2.16.840.1.113883.3.464.1003.106.12.1005",
                "accessLevel": "Public"
              },
              {
                "localId": "10",
                "locator": "16:1-16:83",
                "name": "Detoxification Visit",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1059",
                "accessLevel": "Public"
              },
              {
                "localId": "11",
                "locator": "17:1-17:102",
                "name": "Discharge Services - Hospital Inpatient",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1007",
                "accessLevel": "Public"
              },
              {
                "localId": "12",
                "locator": "18:1-18:121",
                "name": "Discharge Services - Hospital Inpatient Same Day Discharge",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1006",
                "accessLevel": "Public"
              },
              {
                "localId": "13",
                "locator": "19:1-19:89",
                "name": "Emergency Department Visit",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1010",
                "accessLevel": "Public"
              },
              {
                "localId": "14",
                "locator": "20:1-20:97",
                "name": "Hospital Inpatient Visit - Initial",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1004",
                "accessLevel": "Public"
              },
              {
                "localId": "15",
                "locator": "21:1-21:98",
                "name": "Hospital Observation Care - Initial",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1002",
                "accessLevel": "Public"
              },
              {
                "localId": "16",
                "locator": "22:1-22:75",
                "name": "Office Visit",
                "id": "2.16.840.1.113883.3.464.1003.101.12.1001",
                "accessLevel": "Public"
              },
              {
                "localId": "17",
                "locator": "23:1-23:80",
                "name": "Psych Visit - Psychotherapy",
                "id": "2.16.840.1.113883.3.526.3.1496",
                "accessLevel": "Public"
              }
            ]
          },
          "statements": {
            "def": [
              {
                "locator": "28:1-28:15",
                "name": "Patient",
                "context": "Patient",
                "expression": {
                  "type": "SingletonFrom",
                  "operand": {
                    "locator": "28:1-28:15",
                    "dataType": "{urn:healthit-gov:qdm:v5_3}Patient",
                    "templateId": "Patient",
                    "type": "Retrieve"
                  }
                }
              },
              {
                "localId": "22",
                "locator": "30:1-31:50",
                "name": "SDE Ethnicity",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "22",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Ethnicity\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "21",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Ethnicity\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Ethnicity\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "21",
                  "locator": "31:2-31:50",
                  "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicEthnicity",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "name": "Ethnicity",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "24",
                "locator": "33:1-34:42",
                "name": "SDE Payer",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "24",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Payer\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "23",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Payer\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Payer\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "23",
                  "locator": "34:2-34:42",
                  "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicPayer",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "name": "Payer",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "26",
                "locator": "36:1-37:40",
                "name": "SDE Race",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "26",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Race\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "25",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Race\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Race\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "25",
                  "locator": "37:2-37:40",
                  "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicRace",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "name": "Race",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "28",
                "locator": "39:1-40:57",
                "name": "SDE Sex",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "28",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Sex\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "27",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Sex\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"ONC Administrative Sex\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "27",
                  "locator": "40:2-40:57",
                  "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicSex",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "name": "ONC Administrative Sex",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "60",
                "locator": "53:1-61:66",
                "name": "Qualifying Encounters",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "60",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Qualifying Encounters\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "59",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "54",
                                  "s": [
                                    {
                                      "r": "53",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "53",
                                          "s": [
                                            {
                                              "r": "51",
                                              "s": [
                                                {
                                                  "r": "49",
                                                  "s": [
                                                    {
                                                      "r": "47",
                                                      "s": [
                                                        {
                                                          "r": "45",
                                                          "s": [
                                                            {
                                                              "r": "43",
                                                              "s": [
                                                                {
                                                                  "r": "41",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "[",
                                                                        "\"Encounter, Performed\"",
                                                                        ": "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "\"Office Visit\""
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "]"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "\n\t\tunion "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "42",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "[",
                                                                        "\"Encounter, Performed\"",
                                                                        ": "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "\"Emergency Department Visit\""
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "]"
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "\n\t\tunion "
                                                              ]
                                                            },
                                                            {
                                                              "r": "44",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "[",
                                                                    "\"Encounter, Performed\"",
                                                                    ": "
                                                                  ]
                                                                },
                                                                {
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "\"Detoxification Visit\""
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "]"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "\n\t\tunion "
                                                          ]
                                                        },
                                                        {
                                                          "r": "46",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "[",
                                                                "\"Encounter, Performed\"",
                                                                ": "
                                                              ]
                                                            },
                                                            {
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Hospital Observation Care - Initial\""
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "]"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n\t\tunion "
                                                      ]
                                                    },
                                                    {
                                                      "r": "48",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "[",
                                                            "\"Encounter, Performed\"",
                                                            ": "
                                                          ]
                                                        },
                                                        {
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Hospital Inpatient Visit - Initial\""
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "]"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n\t\tunion "
                                                  ]
                                                },
                                                {
                                                  "r": "50",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Encounter, Performed\"",
                                                        ": "
                                                      ]
                                                    },
                                                    {
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Discharge Services - Hospital Inpatient Same Day Discharge\""
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\tunion "
                                              ]
                                            },
                                            {
                                              "r": "52",
                                              "s": [
                                                {
                                                  "value": [
                                                    "[",
                                                    "\"Encounter, Performed\"",
                                                    ": "
                                                  ]
                                                },
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Discharge Services - Hospital Inpatient\""
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "]"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " )"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "ValidEncounters"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t\t"
                              ]
                            },
                            {
                              "r": "58",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "58",
                                  "s": [
                                    {
                                      "r": "56",
                                      "s": [
                                        {
                                          "r": "55",
                                          "s": [
                                            {
                                              "value": [
                                                "ValidEncounters"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "."
                                          ]
                                        },
                                        {
                                          "r": "56",
                                          "s": [
                                            {
                                              "value": [
                                                "relevantPeriod"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "during",
                                        " "
                                      ]
                                    },
                                    {
                                      "r": "57",
                                      "s": [
                                        {
                                          "value": [
                                            "\"Measurement Period\""
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "59",
                  "locator": "54:2-61:66",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "54",
                      "locator": "54:2-60:93",
                      "alias": "ValidEncounters",
                      "expression": {
                        "localId": "53",
                        "locator": "54:2-60:77",
                        "type": "Union",
                        "operand": [
                          {
                            "localId": "51",
                            "locator": "54:4-59:94",
                            "type": "Union",
                            "operand": [
                              {
                                "localId": "49",
                                "locator": "54:4-58:70",
                                "type": "Union",
                                "operand": [
                                  {
                                    "localId": "47",
                                    "locator": "54:4-57:71",
                                    "type": "Union",
                                    "operand": [
                                      {
                                        "localId": "45",
                                        "locator": "54:4-56:56",
                                        "type": "Union",
                                        "operand": [
                                          {
                                            "localId": "43",
                                            "locator": "54:4-55:62",
                                            "type": "Union",
                                            "operand": [
                                              {
                                                "localId": "41",
                                                "locator": "54:4-54:43",
                                                "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                                "templateId": "PositiveEncounterPerformed",
                                                "codeProperty": "code",
                                                "type": "Retrieve",
                                                "codes": {
                                                  "name": "Office Visit",
                                                  "type": "ValueSetRef"
                                                }
                                              },
                                              {
                                                "localId": "42",
                                                "locator": "55:9-55:62",
                                                "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                                "templateId": "PositiveEncounterPerformed",
                                                "codeProperty": "code",
                                                "type": "Retrieve",
                                                "codes": {
                                                  "name": "Emergency Department Visit",
                                                  "type": "ValueSetRef"
                                                }
                                              }
                                            ]
                                          },
                                          {
                                            "localId": "44",
                                            "locator": "56:9-56:56",
                                            "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                            "templateId": "PositiveEncounterPerformed",
                                            "codeProperty": "code",
                                            "type": "Retrieve",
                                            "codes": {
                                              "name": "Detoxification Visit",
                                              "type": "ValueSetRef"
                                            }
                                          }
                                        ]
                                      },
                                      {
                                        "localId": "46",
                                        "locator": "57:9-57:71",
                                        "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                        "templateId": "PositiveEncounterPerformed",
                                        "codeProperty": "code",
                                        "type": "Retrieve",
                                        "codes": {
                                          "name": "Hospital Observation Care - Initial",
                                          "type": "ValueSetRef"
                                        }
                                      }
                                    ]
                                  },
                                  {
                                    "localId": "48",
                                    "locator": "58:9-58:70",
                                    "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                    "templateId": "PositiveEncounterPerformed",
                                    "codeProperty": "code",
                                    "type": "Retrieve",
                                    "codes": {
                                      "name": "Hospital Inpatient Visit - Initial",
                                      "type": "ValueSetRef"
                                    }
                                  }
                                ]
                              },
                              {
                                "localId": "50",
                                "locator": "59:9-59:94",
                                "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                "templateId": "PositiveEncounterPerformed",
                                "codeProperty": "code",
                                "type": "Retrieve",
                                "codes": {
                                  "name": "Discharge Services - Hospital Inpatient Same Day Discharge",
                                  "type": "ValueSetRef"
                                }
                              }
                            ]
                          },
                          {
                            "localId": "52",
                            "locator": "60:9-60:75",
                            "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                            "templateId": "PositiveEncounterPerformed",
                            "codeProperty": "code",
                            "type": "Retrieve",
                            "codes": {
                              "name": "Discharge Services - Hospital Inpatient",
                              "type": "ValueSetRef"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "58",
                    "locator": "61:3-61:66",
                    "type": "IncludedIn",
                    "operand": [
                      {
                        "localId": "56",
                        "locator": "61:9-61:38",
                        "path": "relevantPeriod",
                        "scope": "ValidEncounters",
                        "type": "Property"
                      },
                      {
                        "localId": "57",
                        "locator": "61:47-61:66",
                        "name": "Measurement Period",
                        "type": "ParameterRef"
                      }
                    ]
                  }
                }
              },
              {
                "localId": "82",
                "locator": "63:1-69:2",
                "name": "First Dependence Diagnosis",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "82",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"First Dependence Diagnosis\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "81",
                          "s": [
                            {
                              "value": [
                                "First",
                                "("
                              ]
                            },
                            {
                              "r": "80",
                              "s": [
                                {
                                  "s": [
                                    {
                                      "r": "40",
                                      "s": [
                                        {
                                          "r": "39",
                                          "s": [
                                            {
                                              "r": "39",
                                              "s": [
                                                {
                                                  "value": [
                                                    "[",
                                                    "\"Diagnosis\"",
                                                    ": "
                                                  ]
                                                },
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Alcohol and Drug Dependence\""
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "]"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "InitialDependenceDiagnosis"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t\t"
                                  ]
                                },
                                {
                                  "r": "75",
                                  "s": [
                                    {
                                      "value": [
                                        "with"
                                      ]
                                    },
                                    {
                                      "r": "62",
                                      "s": [
                                        {
                                          "r": "61",
                                          "s": [
                                            {
                                              "value": [
                                                "("
                                              ]
                                            },
                                            {
                                              "r": "61",
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Qualifying Encounters\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ")"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "ValidEncounter"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t\tsuch that "
                                      ]
                                    },
                                    {
                                      "r": "74",
                                      "s": [
                                        {
                                          "r": "67",
                                          "s": [
                                            {
                                              "r": "64",
                                              "s": [
                                                {
                                                  "r": "63",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "InitialDependenceDiagnosis"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "64",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "prevalencePeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "starts during",
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "66",
                                              "s": [
                                                {
                                                  "r": "65",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "ValidEncounter"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "66",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "relevantPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t\t\t\t\tand "
                                          ]
                                        },
                                        {
                                          "r": "73",
                                          "s": [
                                            {
                                              "r": "69",
                                              "s": [
                                                {
                                                  "r": "68",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "InitialDependenceDiagnosis"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "69",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "prevalencePeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "73",
                                              "s": [
                                                {
                                                  "value": [
                                                    "starts "
                                                  ]
                                                },
                                                {
                                                  "r": "72",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "319 ",
                                                        "days"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " or less after"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "71",
                                              "s": [
                                                {
                                                  "value": [
                                                    "start of "
                                                  ]
                                                },
                                                {
                                                  "r": "70",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Measurement Period\""
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t\t"
                                  ]
                                },
                                {
                                  "r": "79",
                                  "s": [
                                    {
                                      "value": [
                                        "sort by "
                                      ]
                                    },
                                    {
                                      "r": "78",
                                      "s": [
                                        {
                                          "r": "77",
                                          "s": [
                                            {
                                              "value": [
                                                "start of "
                                              ]
                                            },
                                            {
                                              "r": "76",
                                              "s": [
                                                {
                                                  "value": [
                                                    "prevalencePeriod"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t)"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "81",
                  "locator": "64:2-69:2",
                  "type": "First",
                  "source": {
                    "localId": "80",
                    "locator": "64:8-68:36",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "40",
                        "locator": "64:8-64:78",
                        "alias": "InitialDependenceDiagnosis",
                        "expression": {
                          "localId": "39",
                          "locator": "64:8-64:51",
                          "dataType": "{urn:healthit-gov:qdm:v5_3}Diagnosis",
                          "codeProperty": "code",
                          "type": "Retrieve",
                          "codes": {
                            "name": "Alcohol and Drug Dependence",
                            "type": "ValueSetRef"
                          }
                        }
                      }
                    ],
                    "relationship": [
                      {
                        "localId": "75",
                        "locator": "65:4-67:112",
                        "alias": "ValidEncounter",
                        "type": "With",
                        "expression": {
                          "localId": "61",
                          "locator": "65:8-65:32",
                          "name": "Qualifying Encounters",
                          "type": "ExpressionRef"
                        },
                        "suchThat": {
                          "localId": "74",
                          "locator": "66:15-67:112",
                          "type": "And",
                          "operand": [
                            {
                              "localId": "67",
                              "locator": "66:15-66:101",
                              "type": "In",
                              "operand": [
                                {
                                  "locator": "66:59-66:64",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "64",
                                    "locator": "66:15-66:57",
                                    "path": "prevalencePeriod",
                                    "scope": "InitialDependenceDiagnosis",
                                    "type": "Property"
                                  }
                                },
                                {
                                  "localId": "66",
                                  "locator": "66:73-66:101",
                                  "path": "relevantPeriod",
                                  "scope": "ValidEncounter",
                                  "type": "Property"
                                }
                              ]
                            },
                            {
                              "localId": "73",
                              "locator": "67:10-67:112",
                              "type": "In",
                              "operand": [
                                {
                                  "locator": "67:54-67:59",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "69",
                                    "locator": "67:10-67:52",
                                    "path": "prevalencePeriod",
                                    "scope": "InitialDependenceDiagnosis",
                                    "type": "Property"
                                  }
                                },
                                {
                                  "locator": "67:61-67:76",
                                  "lowClosed": false,
                                  "highClosed": true,
                                  "type": "Interval",
                                  "low": {
                                    "localId": "71",
                                    "locator": "67:84-67:112",
                                    "type": "Start",
                                    "operand": {
                                      "localId": "70",
                                      "locator": "67:93-67:112",
                                      "name": "Measurement Period",
                                      "type": "ParameterRef"
                                    }
                                  },
                                  "high": {
                                    "locator": "67:84-67:112",
                                    "type": "Add",
                                    "operand": [
                                      {
                                        "localId": "71",
                                        "locator": "67:84-67:112",
                                        "type": "Start",
                                        "operand": {
                                          "localId": "70",
                                          "locator": "67:93-67:112",
                                          "name": "Measurement Period",
                                          "type": "ParameterRef"
                                        }
                                      },
                                      {
                                        "localId": "72",
                                        "locator": "67:61-67:68",
                                        "value": 319,
                                        "unit": "days",
                                        "type": "Quantity"
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          ]
                        }
                      }
                    ],
                    "sort": {
                      "localId": "79",
                      "locator": "68:4-68:36",
                      "by": [
                        {
                          "localId": "78",
                          "locator": "68:12-68:36",
                          "direction": "asc",
                          "type": "ByExpression",
                          "expression": {
                            "localId": "77",
                            "locator": "68:12-68:36",
                            "type": "Start",
                            "operand": {
                              "localId": "76",
                              "locator": "68:21-68:36",
                              "name": "prevalencePeriod",
                              "type": "IdentifierRef"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "localId": "88",
                "locator": "103:1-106:47",
                "name": "Initial Population",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "88",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Initial Population\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "87",
                          "s": [
                            {
                              "value": [
                                "exists "
                              ]
                            },
                            {
                              "r": "86",
                              "s": [
                                {
                                  "s": [
                                    {
                                      "r": "30",
                                      "s": [
                                        {
                                          "r": "29",
                                          "s": [
                                            {
                                              "r": "29",
                                              "s": [
                                                {
                                                  "value": [
                                                    "[",
                                                    "\"Patient Characteristic Birthdate\"",
                                                    "]"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "BirthDate"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t"
                                  ]
                                },
                                {
                                  "r": "85",
                                  "s": [
                                    {
                                      "value": [
                                        "where "
                                      ]
                                    },
                                    {
                                      "r": "85",
                                      "s": [
                                        {
                                          "r": "38",
                                          "s": [
                                            {
                                              "r": "36",
                                              "s": [
                                                {
                                                  "r": "31",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Global"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "36",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"CalendarAgeInYearsAt\"",
                                                        "("
                                                      ]
                                                    },
                                                    {
                                                      "r": "33",
                                                      "s": [
                                                        {
                                                          "r": "32",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "BirthDate"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "."
                                                          ]
                                                        },
                                                        {
                                                          "r": "33",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "birthDatetime"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        ", "
                                                      ]
                                                    },
                                                    {
                                                      "r": "35",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "start of "
                                                          ]
                                                        },
                                                        {
                                                          "r": "34",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Measurement Period\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        ")"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ">=",
                                                " ",
                                                "13"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t\t\tand "
                                          ]
                                        },
                                        {
                                          "r": "84",
                                          "s": [
                                            {
                                              "r": "83",
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"First Dependence Diagnosis\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " is not null"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "87",
                  "locator": "104:2-106:47",
                  "type": "Exists",
                  "operand": {
                    "localId": "86",
                    "locator": "104:9-106:47",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "30",
                        "locator": "104:9-104:54",
                        "alias": "BirthDate",
                        "expression": {
                          "localId": "29",
                          "locator": "104:9-104:44",
                          "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicBirthdate",
                          "type": "Retrieve"
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "where": {
                      "localId": "85",
                      "locator": "105:3-106:47",
                      "type": "And",
                      "operand": [
                        {
                          "localId": "38",
                          "locator": "105:9-105:98",
                          "type": "GreaterOrEqual",
                          "operand": [
                            {
                              "localId": "36",
                              "locator": "105:9-105:93",
                              "name": "CalendarAgeInYearsAt",
                              "libraryName": "Global",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "33",
                                  "locator": "105:39-105:61",
                                  "path": "birthDatetime",
                                  "scope": "BirthDate",
                                  "type": "Property"
                                },
                                {
                                  "localId": "35",
                                  "locator": "105:64-105:92",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "34",
                                    "locator": "105:73-105:92",
                                    "name": "Measurement Period",
                                    "type": "ParameterRef"
                                  }
                                }
                              ]
                            },
                            {
                              "localId": "37",
                              "locator": "105:97-105:98",
                              "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                              "value": "13",
                              "type": "Literal"
                            }
                          ]
                        },
                        {
                          "localId": "84",
                          "locator": "106:8-106:47",
                          "type": "Not",
                          "operand": {
                            "locator": "106:8-106:47",
                            "type": "IsNull",
                            "operand": {
                              "localId": "83",
                              "locator": "106:8-106:35",
                              "name": "First Dependence Diagnosis",
                              "type": "ExpressionRef"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "localId": "90",
                "locator": "42:1-43:21",
                "name": "Denominator",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "90",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Denominator\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "89",
                          "s": [
                            {
                              "value": [
                                "\"Initial Population\""
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "89",
                  "locator": "43:2-43:21",
                  "name": "Initial Population",
                  "type": "ExpressionRef"
                }
              },
              {
                "localId": "110",
                "locator": "71:1-76:2",
                "name": "Treatment Initiation",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "110",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Treatment Initiation\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "109",
                          "s": [
                            {
                              "value": [
                                "( "
                              ]
                            },
                            {
                              "r": "109",
                              "s": [
                                {
                                  "s": [
                                    {
                                      "r": "98",
                                      "s": [
                                        {
                                          "r": "97",
                                          "s": [
                                            {
                                              "value": [
                                                "( "
                                              ]
                                            },
                                            {
                                              "r": "97",
                                              "s": [
                                                {
                                                  "r": "95",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Encounter, Performed\"",
                                                        ": "
                                                      ]
                                                    },
                                                    {
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Alcohol and Drug Dependence Treatment\""
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n\t\t\tunion "
                                                  ]
                                                },
                                                {
                                                  "r": "96",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Encounter, Performed\"",
                                                        ": "
                                                      ]
                                                    },
                                                    {
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Psych Visit - Psychotherapy\""
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " )"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "InitiatedTreatment"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t\t"
                                  ]
                                },
                                {
                                  "r": "108",
                                  "s": [
                                    {
                                      "value": [
                                        "with "
                                      ]
                                    },
                                    {
                                      "r": "100",
                                      "s": [
                                        {
                                          "r": "99",
                                          "s": [
                                            {
                                              "value": [
                                                "( "
                                              ]
                                            },
                                            {
                                              "r": "99",
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"First Dependence Diagnosis\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " )"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "FirstDiagnosed"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t\tsuch that "
                                      ]
                                    },
                                    {
                                      "r": "107",
                                      "s": [
                                        {
                                          "r": "102",
                                          "s": [
                                            {
                                              "r": "101",
                                              "s": [
                                                {
                                                  "value": [
                                                    "InitiatedTreatment"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "."
                                              ]
                                            },
                                            {
                                              "r": "102",
                                              "s": [
                                                {
                                                  "value": [
                                                    "relevantPeriod"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " "
                                          ]
                                        },
                                        {
                                          "r": "107",
                                          "s": [
                                            {
                                              "value": [
                                                "starts "
                                              ]
                                            },
                                            {
                                              "r": "106",
                                              "s": [
                                                {
                                                  "value": [
                                                    "14 ",
                                                    "days"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " or less after day of"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " "
                                          ]
                                        },
                                        {
                                          "r": "105",
                                          "s": [
                                            {
                                              "value": [
                                                "start of "
                                              ]
                                            },
                                            {
                                              "r": "104",
                                              "s": [
                                                {
                                                  "r": "103",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "FirstDiagnosed"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "104",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "prevalencePeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t)"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "109",
                  "locator": "72:2-76:2",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "98",
                      "locator": "72:4-73:85",
                      "alias": "InitiatedTreatment",
                      "expression": {
                        "localId": "97",
                        "locator": "72:4-73:66",
                        "type": "Union",
                        "operand": [
                          {
                            "localId": "95",
                            "locator": "72:6-72:70",
                            "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                            "templateId": "PositiveEncounterPerformed",
                            "codeProperty": "code",
                            "type": "Retrieve",
                            "codes": {
                              "name": "Alcohol and Drug Dependence Treatment",
                              "type": "ValueSetRef"
                            }
                          },
                          {
                            "localId": "96",
                            "locator": "73:10-73:64",
                            "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                            "templateId": "PositiveEncounterPerformed",
                            "codeProperty": "code",
                            "type": "Retrieve",
                            "codes": {
                              "name": "Psych Visit - Psychotherapy",
                              "type": "ValueSetRef"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "relationship": [
                    {
                      "localId": "108",
                      "locator": "74:4-75:124",
                      "alias": "FirstDiagnosed",
                      "type": "With",
                      "expression": {
                        "localId": "99",
                        "locator": "74:9-74:40",
                        "name": "First Dependence Diagnosis",
                        "type": "ExpressionRef"
                      },
                      "suchThat": {
                        "localId": "107",
                        "locator": "75:15-75:124",
                        "precision": "Day",
                        "type": "In",
                        "operand": [
                          {
                            "locator": "75:49-75:54",
                            "type": "Start",
                            "operand": {
                              "localId": "102",
                              "locator": "75:15-75:47",
                              "path": "relevantPeriod",
                              "scope": "InitiatedTreatment",
                              "type": "Property"
                            }
                          },
                          {
                            "locator": "75:56-75:70",
                            "lowClosed": false,
                            "highClosed": true,
                            "type": "Interval",
                            "low": {
                              "localId": "105",
                              "locator": "75:85-75:124",
                              "type": "Start",
                              "operand": {
                                "localId": "104",
                                "locator": "75:94-75:124",
                                "path": "prevalencePeriod",
                                "scope": "FirstDiagnosed",
                                "type": "Property"
                              }
                            },
                            "high": {
                              "locator": "75:85-75:124",
                              "type": "Add",
                              "operand": [
                                {
                                  "localId": "105",
                                  "locator": "75:85-75:124",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "104",
                                    "locator": "75:94-75:124",
                                    "path": "prevalencePeriod",
                                    "scope": "FirstDiagnosed",
                                    "type": "Property"
                                  }
                                },
                                {
                                  "localId": "106",
                                  "locator": "75:56-75:62",
                                  "value": 14,
                                  "unit": "days",
                                  "type": "Quantity"
                                }
                              ]
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              },
              {
                "localId": "125",
                "locator": "96:1-101:6",
                "name": "Has Continuation Of Treatments",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "125",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Has Continuation Of Treatments\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "124",
                          "s": [
                            {
                              "r": "122",
                              "s": [
                                {
                                  "value": [
                                    "Count",
                                    "("
                                  ]
                                },
                                {
                                  "r": "121",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "94",
                                          "s": [
                                            {
                                              "r": "93",
                                              "s": [
                                                {
                                                  "value": [
                                                    "("
                                                  ]
                                                },
                                                {
                                                  "r": "93",
                                                  "s": [
                                                    {
                                                      "r": "91",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "[",
                                                            "\"Encounter, Performed\"",
                                                            ": "
                                                          ]
                                                        },
                                                        {
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Alcohol and Drug Dependence Treatment\""
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "]"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n\t\t\tunion "
                                                      ]
                                                    },
                                                    {
                                                      "r": "92",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "[",
                                                            "\"Encounter, Performed\"",
                                                            ": "
                                                          ]
                                                        },
                                                        {
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Psych Visit - Psychotherapy\""
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "]"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    ")"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "ContinuedTreatment"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t"
                                      ]
                                    },
                                    {
                                      "r": "120",
                                      "s": [
                                        {
                                          "value": [
                                            "with"
                                          ]
                                        },
                                        {
                                          "r": "112",
                                          "s": [
                                            {
                                              "r": "111",
                                              "s": [
                                                {
                                                  "value": [
                                                    "("
                                                  ]
                                                },
                                                {
                                                  "r": "111",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Treatment Initiation\""
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    ")"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "InitiatedTreatment"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t\t\t\tsuch that "
                                          ]
                                        },
                                        {
                                          "r": "119",
                                          "s": [
                                            {
                                              "r": "114",
                                              "s": [
                                                {
                                                  "r": "113",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "ContinuedTreatment"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "114",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "relevantPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "119",
                                              "s": [
                                                {
                                                  "value": [
                                                    "starts "
                                                  ]
                                                },
                                                {
                                                  "r": "118",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "30 ",
                                                        "days"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " or less after"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "117",
                                              "s": [
                                                {
                                                  "value": [
                                                    "start of "
                                                  ]
                                                },
                                                {
                                                  "r": "116",
                                                  "s": [
                                                    {
                                                      "r": "115",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "InitiatedTreatment"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "116",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "relevantPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t)"
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                ">=",
                                " ",
                                "2"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "124",
                  "locator": "97:2-101:6",
                  "type": "GreaterOrEqual",
                  "operand": [
                    {
                      "localId": "122",
                      "locator": "97:2-101:2",
                      "type": "Count",
                      "source": {
                        "localId": "121",
                        "locator": "97:8-100:119",
                        "type": "Query",
                        "source": [
                          {
                            "localId": "94",
                            "locator": "97:8-98:83",
                            "alias": "ContinuedTreatment",
                            "expression": {
                              "localId": "93",
                              "locator": "97:8-98:65",
                              "type": "Union",
                              "operand": [
                                {
                                  "localId": "91",
                                  "locator": "97:9-97:73",
                                  "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                  "templateId": "PositiveEncounterPerformed",
                                  "codeProperty": "code",
                                  "type": "Retrieve",
                                  "codes": {
                                    "name": "Alcohol and Drug Dependence Treatment",
                                    "type": "ValueSetRef"
                                  }
                                },
                                {
                                  "localId": "92",
                                  "locator": "98:10-98:64",
                                  "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                  "templateId": "PositiveEncounterPerformed",
                                  "codeProperty": "code",
                                  "type": "Retrieve",
                                  "codes": {
                                    "name": "Psych Visit - Psychotherapy",
                                    "type": "ValueSetRef"
                                  }
                                }
                              ]
                            }
                          }
                        ],
                        "relationship": [
                          {
                            "localId": "120",
                            "locator": "99:4-100:119",
                            "alias": "InitiatedTreatment",
                            "type": "With",
                            "expression": {
                              "localId": "111",
                              "locator": "99:8-99:31",
                              "name": "Treatment Initiation",
                              "type": "ExpressionRef"
                            },
                            "suchThat": {
                              "localId": "119",
                              "locator": "100:15-100:119",
                              "type": "In",
                              "operand": [
                                {
                                  "locator": "100:49-100:54",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "114",
                                    "locator": "100:15-100:47",
                                    "path": "relevantPeriod",
                                    "scope": "ContinuedTreatment",
                                    "type": "Property"
                                  }
                                },
                                {
                                  "locator": "100:56-100:70",
                                  "lowClosed": false,
                                  "highClosed": true,
                                  "type": "Interval",
                                  "low": {
                                    "localId": "117",
                                    "locator": "100:78-100:119",
                                    "type": "Start",
                                    "operand": {
                                      "localId": "116",
                                      "locator": "100:87-100:119",
                                      "path": "relevantPeriod",
                                      "scope": "InitiatedTreatment",
                                      "type": "Property"
                                    }
                                  },
                                  "high": {
                                    "locator": "100:78-100:119",
                                    "type": "Add",
                                    "operand": [
                                      {
                                        "localId": "117",
                                        "locator": "100:78-100:119",
                                        "type": "Start",
                                        "operand": {
                                          "localId": "116",
                                          "locator": "100:87-100:119",
                                          "path": "relevantPeriod",
                                          "scope": "InitiatedTreatment",
                                          "type": "Property"
                                        }
                                      },
                                      {
                                        "localId": "118",
                                        "locator": "100:56-100:62",
                                        "value": 30,
                                        "unit": "days",
                                        "type": "Quantity"
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          }
                        ]
                      }
                    },
                    {
                      "localId": "123",
                      "locator": "101:6",
                      "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                      "value": "2",
                      "type": "Literal"
                    }
                  ]
                }
              },
              {
                "localId": "127",
                "locator": "45:1-46:33",
                "name": "Numerator 2",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "127",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Numerator 2\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "126",
                          "s": [
                            {
                              "value": [
                                "\"Has Continuation Of Treatments\""
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "126",
                  "locator": "46:2-46:33",
                  "name": "Has Continuation Of Treatments",
                  "type": "ExpressionRef"
                }
              },
              {
                "localId": "140",
                "locator": "48:1-51:2",
                "name": "Stratification 2",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "140",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Stratification 2\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "139",
                          "s": [
                            {
                              "value": [
                                "exists "
                              ]
                            },
                            {
                              "r": "138",
                              "s": [
                                {
                                  "value": [
                                    "( "
                                  ]
                                },
                                {
                                  "r": "138",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "129",
                                          "s": [
                                            {
                                              "r": "128",
                                              "s": [
                                                {
                                                  "r": "128",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Patient Characteristic Birthdate\"",
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "BirthDate"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t"
                                      ]
                                    },
                                    {
                                      "r": "137",
                                      "s": [
                                        {
                                          "value": [
                                            "where "
                                          ]
                                        },
                                        {
                                          "r": "137",
                                          "s": [
                                            {
                                              "r": "135",
                                              "s": [
                                                {
                                                  "r": "130",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Global"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "135",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"CalendarAgeInYearsAt\"",
                                                        "("
                                                      ]
                                                    },
                                                    {
                                                      "r": "132",
                                                      "s": [
                                                        {
                                                          "r": "131",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "BirthDate"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "."
                                                          ]
                                                        },
                                                        {
                                                          "r": "132",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "birthDatetime"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        ", "
                                                      ]
                                                    },
                                                    {
                                                      "r": "134",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "start of "
                                                          ]
                                                        },
                                                        {
                                                          "r": "133",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Measurement Period\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        ")"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ">=",
                                                " ",
                                                "18"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t)"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "139",
                  "locator": "49:2-51:2",
                  "type": "Exists",
                  "operand": {
                    "localId": "138",
                    "locator": "49:9-51:2",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "129",
                        "locator": "49:11-49:56",
                        "alias": "BirthDate",
                        "expression": {
                          "localId": "128",
                          "locator": "49:11-49:46",
                          "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicBirthdate",
                          "type": "Retrieve"
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "where": {
                      "localId": "137",
                      "locator": "50:4-50:99",
                      "type": "GreaterOrEqual",
                      "operand": [
                        {
                          "localId": "135",
                          "locator": "50:10-50:94",
                          "name": "CalendarAgeInYearsAt",
                          "libraryName": "Global",
                          "type": "FunctionRef",
                          "operand": [
                            {
                              "localId": "132",
                              "locator": "50:40-50:62",
                              "path": "birthDatetime",
                              "scope": "BirthDate",
                              "type": "Property"
                            },
                            {
                              "localId": "134",
                              "locator": "50:65-50:93",
                              "type": "Start",
                              "operand": {
                                "localId": "133",
                                "locator": "50:74-50:93",
                                "name": "Measurement Period",
                                "type": "ParameterRef"
                              }
                            }
                          ]
                        },
                        {
                          "localId": "136",
                          "locator": "50:98-50:99",
                          "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                          "value": "18",
                          "type": "Literal"
                        }
                      ]
                    }
                  }
                }
              },
              {
                "localId": "162",
                "locator": "78:1-82:2",
                "name": "Stratification 1",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "162",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Stratification 1\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "161",
                          "s": [
                            {
                              "value": [
                                "exists "
                              ]
                            },
                            {
                              "r": "160",
                              "s": [
                                {
                                  "value": [
                                    "( "
                                  ]
                                },
                                {
                                  "r": "160",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "142",
                                          "s": [
                                            {
                                              "r": "141",
                                              "s": [
                                                {
                                                  "r": "141",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Patient Characteristic Birthdate\"",
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "BirthDate"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t"
                                      ]
                                    },
                                    {
                                      "r": "159",
                                      "s": [
                                        {
                                          "value": [
                                            "where "
                                          ]
                                        },
                                        {
                                          "r": "159",
                                          "s": [
                                            {
                                              "r": "150",
                                              "s": [
                                                {
                                                  "r": "148",
                                                  "s": [
                                                    {
                                                      "r": "143",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Global"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "148",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"CalendarAgeInYearsAt\"",
                                                            "("
                                                          ]
                                                        },
                                                        {
                                                          "r": "145",
                                                          "s": [
                                                            {
                                                              "r": "144",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "BirthDate"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "145",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "birthDatetime"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            ", "
                                                          ]
                                                        },
                                                        {
                                                          "r": "147",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "start of "
                                                              ]
                                                            },
                                                            {
                                                              "r": "146",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Measurement Period\""
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            ")"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    ">=",
                                                    " ",
                                                    "13"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\t\t\tand "
                                              ]
                                            },
                                            {
                                              "r": "158",
                                              "s": [
                                                {
                                                  "r": "156",
                                                  "s": [
                                                    {
                                                      "r": "151",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Global"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "156",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"CalendarAgeInYearsAt\"",
                                                            "("
                                                          ]
                                                        },
                                                        {
                                                          "r": "153",
                                                          "s": [
                                                            {
                                                              "r": "152",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "BirthDate"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "153",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "birthDatetime"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            ", "
                                                          ]
                                                        },
                                                        {
                                                          "r": "155",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "start of "
                                                              ]
                                                            },
                                                            {
                                                              "r": "154",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Measurement Period\""
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            ")"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "<",
                                                    " ",
                                                    "18"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t)"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "161",
                  "locator": "79:2-82:2",
                  "type": "Exists",
                  "operand": {
                    "localId": "160",
                    "locator": "79:9-82:2",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "142",
                        "locator": "79:11-79:56",
                        "alias": "BirthDate",
                        "expression": {
                          "localId": "141",
                          "locator": "79:11-79:46",
                          "dataType": "{urn:healthit-gov:qdm:v5_3}PatientCharacteristicBirthdate",
                          "type": "Retrieve"
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "where": {
                      "localId": "159",
                      "locator": "80:4-81:97",
                      "type": "And",
                      "operand": [
                        {
                          "localId": "150",
                          "locator": "80:10-80:99",
                          "type": "GreaterOrEqual",
                          "operand": [
                            {
                              "localId": "148",
                              "locator": "80:10-80:94",
                              "name": "CalendarAgeInYearsAt",
                              "libraryName": "Global",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "145",
                                  "locator": "80:40-80:62",
                                  "path": "birthDatetime",
                                  "scope": "BirthDate",
                                  "type": "Property"
                                },
                                {
                                  "localId": "147",
                                  "locator": "80:65-80:93",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "146",
                                    "locator": "80:74-80:93",
                                    "name": "Measurement Period",
                                    "type": "ParameterRef"
                                  }
                                }
                              ]
                            },
                            {
                              "localId": "149",
                              "locator": "80:98-80:99",
                              "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                              "value": "13",
                              "type": "Literal"
                            }
                          ]
                        },
                        {
                          "localId": "158",
                          "locator": "81:9-81:97",
                          "type": "Less",
                          "operand": [
                            {
                              "localId": "156",
                              "locator": "81:9-81:93",
                              "name": "CalendarAgeInYearsAt",
                              "libraryName": "Global",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "153",
                                  "locator": "81:39-81:61",
                                  "path": "birthDatetime",
                                  "scope": "BirthDate",
                                  "type": "Property"
                                },
                                {
                                  "localId": "155",
                                  "locator": "81:64-81:92",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "154",
                                    "locator": "81:73-81:92",
                                    "name": "Measurement Period",
                                    "type": "ParameterRef"
                                  }
                                }
                              ]
                            },
                            {
                              "localId": "157",
                              "locator": "81:96-81:97",
                              "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                              "value": "18",
                              "type": "Literal"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              },
              {
                "localId": "178",
                "locator": "91:1-94:125",
                "name": "Has Prior Dependence",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "178",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Has Prior Dependence\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "177",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "166",
                                  "s": [
                                    {
                                      "r": "165",
                                      "s": [
                                        {
                                          "r": "165",
                                          "s": [
                                            {
                                              "value": [
                                                "[",
                                                "\"Diagnosis\"",
                                                ": "
                                              ]
                                            },
                                            {
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Alcohol and Drug Dependence\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "]"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "PriorDependenceDiagnosis"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t\t"
                              ]
                            },
                            {
                              "r": "176",
                              "s": [
                                {
                                  "value": [
                                    "with "
                                  ]
                                },
                                {
                                  "r": "168",
                                  "s": [
                                    {
                                      "r": "167",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "167",
                                          "s": [
                                            {
                                              "value": [
                                                "\"First Dependence Diagnosis\""
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " )"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "FirstDiagnosed"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t\tsuch that "
                                  ]
                                },
                                {
                                  "r": "175",
                                  "s": [
                                    {
                                      "r": "170",
                                      "s": [
                                        {
                                          "r": "169",
                                          "s": [
                                            {
                                              "value": [
                                                "PriorDependenceDiagnosis"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "."
                                          ]
                                        },
                                        {
                                          "r": "170",
                                          "s": [
                                            {
                                              "value": [
                                                "prevalencePeriod"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " "
                                      ]
                                    },
                                    {
                                      "r": "175",
                                      "s": [
                                        {
                                          "value": [
                                            "starts "
                                          ]
                                        },
                                        {
                                          "r": "174",
                                          "s": [
                                            {
                                              "value": [
                                                "60 ",
                                                "days"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " or less before"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " "
                                      ]
                                    },
                                    {
                                      "r": "173",
                                      "s": [
                                        {
                                          "value": [
                                            "start of "
                                          ]
                                        },
                                        {
                                          "r": "172",
                                          "s": [
                                            {
                                              "r": "171",
                                              "s": [
                                                {
                                                  "value": [
                                                    "FirstDiagnosed"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "."
                                              ]
                                            },
                                            {
                                              "r": "172",
                                              "s": [
                                                {
                                                  "value": [
                                                    "prevalencePeriod"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "177",
                  "locator": "92:2-94:125",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "166",
                      "locator": "92:2-92:70",
                      "alias": "PriorDependenceDiagnosis",
                      "expression": {
                        "localId": "165",
                        "locator": "92:2-92:45",
                        "dataType": "{urn:healthit-gov:qdm:v5_3}Diagnosis",
                        "codeProperty": "code",
                        "type": "Retrieve",
                        "codes": {
                          "name": "Alcohol and Drug Dependence",
                          "type": "ValueSetRef"
                        }
                      }
                    }
                  ],
                  "relationship": [
                    {
                      "localId": "176",
                      "locator": "93:3-94:125",
                      "alias": "FirstDiagnosed",
                      "type": "With",
                      "expression": {
                        "localId": "167",
                        "locator": "93:8-93:39",
                        "name": "First Dependence Diagnosis",
                        "type": "ExpressionRef"
                      },
                      "suchThat": {
                        "localId": "175",
                        "locator": "94:14-94:125",
                        "type": "In",
                        "operand": [
                          {
                            "locator": "94:56-94:61",
                            "type": "Start",
                            "operand": {
                              "localId": "170",
                              "locator": "94:14-94:54",
                              "path": "prevalencePeriod",
                              "scope": "PriorDependenceDiagnosis",
                              "type": "Property"
                            }
                          },
                          {
                            "locator": "94:63-94:77",
                            "lowClosed": true,
                            "highClosed": false,
                            "type": "Interval",
                            "low": {
                              "locator": "94:86-94:125",
                              "type": "Subtract",
                              "operand": [
                                {
                                  "localId": "173",
                                  "locator": "94:86-94:125",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "172",
                                    "locator": "94:95-94:125",
                                    "path": "prevalencePeriod",
                                    "scope": "FirstDiagnosed",
                                    "type": "Property"
                                  }
                                },
                                {
                                  "localId": "174",
                                  "locator": "94:63-94:69",
                                  "value": 60,
                                  "unit": "days",
                                  "type": "Quantity"
                                }
                              ]
                            },
                            "high": {
                              "localId": "173",
                              "locator": "94:86-94:125",
                              "type": "Start",
                              "operand": {
                                "localId": "172",
                                "locator": "94:95-94:125",
                                "path": "prevalencePeriod",
                                "scope": "FirstDiagnosed",
                                "type": "Property"
                              }
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              },
              {
                "localId": "182",
                "locator": "84:1-86:34",
                "name": "Denominator Exclusions",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "182",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Denominator Exclusions\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "181",
                          "s": [
                            {
                              "r": "164",
                              "s": [
                                {
                                  "r": "163",
                                  "s": [
                                    {
                                      "value": [
                                        "Hospice"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "."
                                  ]
                                },
                                {
                                  "r": "164",
                                  "s": [
                                    {
                                      "value": [
                                        "\"Has Hospice\""
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t\tor "
                              ]
                            },
                            {
                              "r": "180",
                              "s": [
                                {
                                  "value": [
                                    "exists "
                                  ]
                                },
                                {
                                  "r": "179",
                                  "s": [
                                    {
                                      "value": [
                                        "\"Has Prior Dependence\""
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "181",
                  "locator": "85:2-86:34",
                  "type": "Or",
                  "operand": [
                    {
                      "localId": "164",
                      "locator": "85:2-85:22",
                      "name": "Has Hospice",
                      "libraryName": "Hospice",
                      "type": "ExpressionRef"
                    },
                    {
                      "localId": "180",
                      "locator": "86:6-86:34",
                      "type": "Exists",
                      "operand": {
                        "localId": "179",
                        "locator": "86:13-86:34",
                        "name": "Has Prior Dependence",
                        "type": "ExpressionRef"
                      }
                    }
                  ]
                }
              },
              {
                "localId": "185",
                "locator": "88:1-89:30",
                "name": "Numerator",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "185",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Numerator\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "184",
                          "s": [
                            {
                              "value": [
                                "exists "
                              ]
                            },
                            {
                              "r": "183",
                              "s": [
                                {
                                  "value": [
                                    "\"Treatment Initiation\""
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "184",
                  "locator": "89:2-89:30",
                  "type": "Exists",
                  "operand": {
                    "localId": "183",
                    "locator": "89:9-89:30",
                    "name": "Treatment Initiation",
                    "type": "ExpressionRef"
                  }
                }
              }
            ]
          }
        }
      },
      "elm_annotations": {
        "statements": [
          {
            "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": "21"
                  }
                ],
                "ref_id": "22"
              }
            ],
            "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": "23"
                  }
                ],
                "ref_id": "24"
              }
            ],
            "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": "25"
                  }
                ],
                "ref_id": "26"
              }
            ],
            "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": "27"
                  }
                ],
                "ref_id": "28"
              }
            ],
            "define_name": "SDE Sex"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Qualifying Encounters\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "[\"Encounter, Performed\": "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "\"Office Visit\""
                                                                      }
                                                                    ]
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "]"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "Retrieve",
                                                            "ref_id": "41"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\n    union "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "[\"Encounter, Performed\": "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "\"Emergency Department Visit\""
                                                                      }
                                                                    ]
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "]"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "Retrieve",
                                                            "ref_id": "42"
                                                          }
                                                        ],
                                                        "node_type": "Union",
                                                        "ref_id": "43"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\n    union "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "[\"Encounter, Performed\": "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "\"Detoxification Visit\""
                                                                  }
                                                                ]
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "]"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Retrieve",
                                                        "ref_id": "44"
                                                      }
                                                    ],
                                                    "node_type": "Union",
                                                    "ref_id": "45"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\n    union "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "[\"Encounter, Performed\": "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Hospital Observation Care - Initial\""
                                                              }
                                                            ]
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "]"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "Retrieve",
                                                    "ref_id": "46"
                                                  }
                                                ],
                                                "node_type": "Union",
                                                "ref_id": "47"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n    union "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "[\"Encounter, Performed\": "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Hospital Inpatient Visit - Initial\""
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "]"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Retrieve",
                                                "ref_id": "48"
                                              }
                                            ],
                                            "node_type": "Union",
                                            "ref_id": "49"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n    union "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Encounter, Performed\": "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Discharge Services - Hospital Inpatient Same Day Discharge\""
                                                      }
                                                    ]
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "50"
                                          }
                                        ],
                                        "node_type": "Union",
                                        "ref_id": "51"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n    union "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "[\"Encounter, Performed\": "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Discharge Services - Hospital Inpatient\""
                                                  }
                                                ]
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "]"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "52"
                                      }
                                    ],
                                    "node_type": "Union",
                                    "ref_id": "53"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Union",
                                "ref_id": "53"
                              },
                              {
                                "children": [
                                  {
                                    "text": " ValidEncounters"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "54"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "ValidEncounters"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "55"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "."
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "relevantPeriod"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "56"
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "56"
                              },
                              {
                                "children": [
                                  {
                                    "text": " during "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "\"Measurement Period\""
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ParameterRef",
                                "ref_id": "57"
                              }
                            ],
                            "ref_id": "58"
                          }
                        ],
                        "ref_id": "58"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "59"
                  }
                ],
                "ref_id": "60"
              }
            ],
            "define_name": "Qualifying Encounters"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"First Dependence Diagnosis\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "First("
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "[\"Diagnosis\": "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Alcohol and Drug Dependence\""
                                                  }
                                                ]
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "]"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "39"
                                      }
                                    ],
                                    "node_type": "Retrieve",
                                    "ref_id": "39"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " InitialDependenceDiagnosis"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "40"
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "text": "\n      "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "with"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "("
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Qualifying Encounters\""
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "ExpressionRef",
                                        "ref_id": "61"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ")"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "ExpressionRef",
                                    "ref_id": "61"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "ValidEncounter"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "62"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n        such that "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "InitialDependenceDiagnosis"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "63"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "prevalencePeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "64"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "64"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " starts during "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "ValidEncounter"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "65"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "relevantPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "66"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "66"
                                      }
                                    ],
                                    "node_type": "In",
                                    "ref_id": "67"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n          and "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "InitialDependenceDiagnosis"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "68"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "prevalencePeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "69"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "69"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "starts "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "319 days"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Quantity",
                                            "ref_id": "72"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " or less after"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "In",
                                        "ref_id": "73"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "start of "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Measurement Period\""
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "ParameterRef",
                                            "ref_id": "70"
                                          }
                                        ],
                                        "node_type": "Start",
                                        "ref_id": "71"
                                      }
                                    ],
                                    "node_type": "In",
                                    "ref_id": "73"
                                  }
                                ],
                                "node_type": "And",
                                "ref_id": "74"
                              }
                            ],
                            "ref_id": "75"
                          },
                          {
                            "children": [
                              {
                                "text": "\n      "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "sort by "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "start of "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "prevalencePeriod"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "IdentifierRef",
                                        "ref_id": "76"
                                      }
                                    ],
                                    "node_type": "Start",
                                    "ref_id": "77"
                                  }
                                ],
                                "ref_id": "78"
                              }
                            ],
                            "ref_id": "79"
                          }
                        ],
                        "ref_id": "80"
                      },
                      {
                        "children": [
                          {
                            "text": "\n  )"
                          }
                        ]
                      }
                    ],
                    "node_type": "First",
                    "ref_id": "81"
                  }
                ],
                "ref_id": "82"
              }
            ],
            "define_name": "First Dependence Diagnosis"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Initial Population\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "exists "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "[\"Patient Characteristic Birthdate\"]"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "29"
                                      }
                                    ],
                                    "node_type": "Retrieve",
                                    "ref_id": "29"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " BirthDate"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "30"
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "text": "\n    "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "where "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Global"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "31"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"CalendarAgeInYearsAt\"("
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "BirthDate"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "32"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "."
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "birthDatetime"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "33"
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "33"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": ", "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "start of "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Measurement Period\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "ParameterRef",
                                                    "ref_id": "34"
                                                  }
                                                ],
                                                "node_type": "Start",
                                                "ref_id": "35"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": ")"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "FunctionRef",
                                            "ref_id": "36"
                                          }
                                        ],
                                        "node_type": "FunctionRef",
                                        "ref_id": "36"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ">= 13"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "GreaterOrEqual",
                                    "ref_id": "38"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n      and "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"First Dependence Diagnosis\""
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "ExpressionRef",
                                        "ref_id": "83"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " is not null"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Not",
                                    "ref_id": "84"
                                  }
                                ],
                                "ref_id": "85"
                              }
                            ],
                            "ref_id": "85"
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "86"
                      }
                    ],
                    "node_type": "Exists",
                    "ref_id": "87"
                  }
                ],
                "ref_id": "88"
              }
            ],
            "define_name": "Initial Population"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Denominator\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Initial Population\""
                          }
                        ]
                      }
                    ],
                    "node_type": "ExpressionRef",
                    "ref_id": "89"
                  }
                ],
                "ref_id": "90"
              }
            ],
            "define_name": "Denominator"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Treatment Initiation\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "( "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "( "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Encounter, Performed\": "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Alcohol and Drug Dependence Treatment\""
                                                      }
                                                    ]
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "95"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n      union "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Encounter, Performed\": "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Psych Visit - Psychotherapy\""
                                                      }
                                                    ]
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "96"
                                          }
                                        ],
                                        "node_type": "Union",
                                        "ref_id": "97"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " )"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Union",
                                    "ref_id": "97"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " InitiatedTreatment"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "98"
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "text": "\n      "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "with "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "( "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"First Dependence Diagnosis\""
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "ExpressionRef",
                                        "ref_id": "99"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " )"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "ExpressionRef",
                                    "ref_id": "99"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " FirstDiagnosed"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "100"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n        such that "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "InitiatedTreatment"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "101"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "."
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "relevantPeriod"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "102"
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "102"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "starts "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "14 days"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Quantity",
                                        "ref_id": "106"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " or less after day of"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "In",
                                    "ref_id": "107"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "start of "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "FirstDiagnosed"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "103"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "prevalencePeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "104"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "104"
                                      }
                                    ],
                                    "node_type": "Start",
                                    "ref_id": "105"
                                  }
                                ],
                                "node_type": "In",
                                "ref_id": "107"
                              }
                            ],
                            "ref_id": "108"
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "109"
                      },
                      {
                        "children": [
                          {
                            "text": "\n  )"
                          }
                        ]
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "109"
                  }
                ],
                "ref_id": "110"
              }
            ],
            "define_name": "Treatment Initiation"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Has Continuation Of Treatments\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "Count("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "("
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "[\"Encounter, Performed\": "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Alcohol and Drug Dependence Treatment\""
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "]"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Retrieve",
                                                "ref_id": "91"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n      union "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "[\"Encounter, Performed\": "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Psych Visit - Psychotherapy\""
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "]"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Retrieve",
                                                "ref_id": "92"
                                              }
                                            ],
                                            "node_type": "Union",
                                            "ref_id": "93"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": ")"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Union",
                                        "ref_id": "93"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "ContinuedTreatment"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "94"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "with"
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "("
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Treatment Initiation\""
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "ExpressionRef",
                                            "ref_id": "111"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": ")"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "ExpressionRef",
                                        "ref_id": "111"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "InitiatedTreatment"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "112"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n        such that "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "ContinuedTreatment"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "113"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "relevantPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "114"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "114"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "starts "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "30 days"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Quantity",
                                            "ref_id": "118"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " or less after"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "In",
                                        "ref_id": "119"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "start of "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "InitiatedTreatment"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "115"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "relevantPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "116"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "116"
                                          }
                                        ],
                                        "node_type": "Start",
                                        "ref_id": "117"
                                      }
                                    ],
                                    "node_type": "In",
                                    "ref_id": "119"
                                  }
                                ],
                                "ref_id": "120"
                              }
                            ],
                            "ref_id": "121"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Count",
                        "ref_id": "122"
                      },
                      {
                        "children": [
                          {
                            "text": ">= 2"
                          }
                        ]
                      }
                    ],
                    "node_type": "GreaterOrEqual",
                    "ref_id": "124"
                  }
                ],
                "ref_id": "125"
              }
            ],
            "define_name": "Has Continuation Of Treatments"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Numerator 2\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Has Continuation Of Treatments\""
                          }
                        ]
                      }
                    ],
                    "node_type": "ExpressionRef",
                    "ref_id": "126"
                  }
                ],
                "ref_id": "127"
              }
            ],
            "define_name": "Numerator 2"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Stratification 2\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "exists "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "( "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Patient Characteristic Birthdate\"]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "128"
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "128"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " BirthDate"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "129"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "where "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Global"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "130"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"CalendarAgeInYearsAt\"("
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "BirthDate"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "131"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "."
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "birthDatetime"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "132"
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "132"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": ", "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "start of "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Measurement Period\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "ParameterRef",
                                                    "ref_id": "133"
                                                  }
                                                ],
                                                "node_type": "Start",
                                                "ref_id": "134"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": ")"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "FunctionRef",
                                            "ref_id": "135"
                                          }
                                        ],
                                        "node_type": "FunctionRef",
                                        "ref_id": "135"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ">= 18"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "137"
                                  }
                                ],
                                "ref_id": "137"
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "138"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "138"
                      }
                    ],
                    "node_type": "Exists",
                    "ref_id": "139"
                  }
                ],
                "ref_id": "140"
              }
            ],
            "define_name": "Stratification 2"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Stratification 1\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "exists "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "( "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Patient Characteristic Birthdate\"]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "141"
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "141"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " BirthDate"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "142"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "where "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Global"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "143"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"CalendarAgeInYearsAt\"("
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "BirthDate"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "144"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "birthDatetime"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "145"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "145"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": ", "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "start of "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Measurement Period\""
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "ParameterRef",
                                                        "ref_id": "146"
                                                      }
                                                    ],
                                                    "node_type": "Start",
                                                    "ref_id": "147"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": ")"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "FunctionRef",
                                                "ref_id": "148"
                                              }
                                            ],
                                            "node_type": "FunctionRef",
                                            "ref_id": "148"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": ">= 13"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "GreaterOrEqual",
                                        "ref_id": "150"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        and "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Global"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "151"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"CalendarAgeInYearsAt\"("
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "BirthDate"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "152"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "birthDatetime"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "153"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "153"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": ", "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "start of "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Measurement Period\""
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "ParameterRef",
                                                        "ref_id": "154"
                                                      }
                                                    ],
                                                    "node_type": "Start",
                                                    "ref_id": "155"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": ")"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "FunctionRef",
                                                "ref_id": "156"
                                              }
                                            ],
                                            "node_type": "FunctionRef",
                                            "ref_id": "156"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "< 18"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Less",
                                        "ref_id": "158"
                                      }
                                    ],
                                    "ref_id": "159"
                                  }
                                ],
                                "ref_id": "159"
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "160"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "160"
                      }
                    ],
                    "node_type": "Exists",
                    "ref_id": "161"
                  }
                ],
                "ref_id": "162"
              }
            ],
            "define_name": "Stratification 1"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Has Prior Dependence\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "[\"Diagnosis\": "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Alcohol and Drug Dependence\""
                                              }
                                            ]
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "]"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Retrieve",
                                    "ref_id": "165"
                                  }
                                ],
                                "node_type": "Retrieve",
                                "ref_id": "165"
                              },
                              {
                                "children": [
                                  {
                                    "text": " PriorDependenceDiagnosis"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "166"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "with "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"First Dependence Diagnosis\""
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "ExpressionRef",
                                    "ref_id": "167"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ExpressionRef",
                                "ref_id": "167"
                              },
                              {
                                "children": [
                                  {
                                    "text": " FirstDiagnosed"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "168"
                          },
                          {
                            "children": [
                              {
                                "text": "\n      such that "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "PriorDependenceDiagnosis"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "169"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "."
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "prevalencePeriod"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "170"
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "170"
                              },
                              {
                                "children": [
                                  {
                                    "text": " "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "starts "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "60 days"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Quantity",
                                    "ref_id": "174"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " or less before"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "In",
                                "ref_id": "175"
                              },
                              {
                                "children": [
                                  {
                                    "text": " "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "start of "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "FirstDiagnosed"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "171"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "."
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "prevalencePeriod"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "172"
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "172"
                                  }
                                ],
                                "node_type": "Start",
                                "ref_id": "173"
                              }
                            ],
                            "node_type": "In",
                            "ref_id": "175"
                          }
                        ],
                        "ref_id": "176"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "177"
                  }
                ],
                "ref_id": "178"
              }
            ],
            "define_name": "Has Prior Dependence"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Denominator Exclusions\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "Hospice"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "163"
                          },
                          {
                            "children": [
                              {
                                "text": "."
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "\"Has Hospice\""
                                  }
                                ]
                              }
                            ],
                            "node_type": "ExpressionRef",
                            "ref_id": "164"
                          }
                        ],
                        "node_type": "ExpressionRef",
                        "ref_id": "164"
                      },
                      {
                        "children": [
                          {
                            "text": "\n    or "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "exists "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "\"Has Prior Dependence\""
                                  }
                                ]
                              }
                            ],
                            "node_type": "ExpressionRef",
                            "ref_id": "179"
                          }
                        ],
                        "node_type": "Exists",
                        "ref_id": "180"
                      }
                    ],
                    "node_type": "Or",
                    "ref_id": "181"
                  }
                ],
                "ref_id": "182"
              }
            ],
            "define_name": "Denominator Exclusions"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Numerator\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "exists "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "\"Treatment Initiation\""
                              }
                            ]
                          }
                        ],
                        "node_type": "ExpressionRef",
                        "ref_id": "183"
                      }
                    ],
                    "node_type": "Exists",
                    "ref_id": "184"
                  }
                ],
                "ref_id": "185"
              }
            ],
            "define_name": "Numerator"
          }
        ],
        "identifier": {
          "id": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "version": "7.2.000"
        }
      },
      "is_main_library": true,
      "is_top_level": true,
      "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
      "library_version": "7.2.000",
      "statement_dependencies": [
        {
          "statement_name": "Patient"
        },
        {
          "statement_name": "SDE Ethnicity"
        },
        {
          "statement_name": "SDE Payer"
        },
        {
          "statement_name": "SDE Race"
        },
        {
          "statement_name": "SDE Sex"
        },
        {
          "statement_name": "Qualifying Encounters"
        },
        {
          "statement_name": "First Dependence Diagnosis",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "Qualifying Encounters"
            }
          ]
        },
        {
          "statement_name": "Initial Population",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "MATGlobalCommonFunctions",
              "statement_name": "CalendarAgeInYearsAt"
            },
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "First Dependence Diagnosis"
            }
          ]
        },
        {
          "statement_name": "Denominator",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "Initial Population"
            }
          ]
        },
        {
          "statement_name": "Treatment Initiation",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "First Dependence Diagnosis"
            }
          ]
        },
        {
          "statement_name": "Has Continuation Of Treatments",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "Treatment Initiation"
            }
          ]
        },
        {
          "statement_name": "Numerator 2",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "Has Continuation Of Treatments"
            }
          ]
        },
        {
          "statement_name": "Stratification 2",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "MATGlobalCommonFunctions",
              "statement_name": "CalendarAgeInYearsAt"
            }
          ]
        },
        {
          "statement_name": "Stratification 1",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "MATGlobalCommonFunctions",
              "statement_name": "CalendarAgeInYearsAt"
            },
            {
              "hqmf_id": null,
              "library_name": "MATGlobalCommonFunctions",
              "statement_name": "CalendarAgeInYearsAt"
            }
          ]
        },
        {
          "statement_name": "Has Prior Dependence",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "First Dependence Diagnosis"
            }
          ]
        },
        {
          "statement_name": "Denominator Exclusions",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "Hospice",
              "statement_name": "Has Hospice"
            },
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "Has Prior Dependence"
            }
          ]
        },
        {
          "statement_name": "Numerator",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
              "statement_name": "Treatment Initiation"
            }
          ]
        }
      ]
    },
    {
      "cql": "library MATGlobalCommonFunctions version '2.0.000'\r\n\r\nusing QDM version '5.3'\r\n\r\ncodesystem \"LOINC:2.46\": 'urn:oid:2.16.840.1.113883.6.1' version 'urn:hl7:version:2.46'\r\ncodesystem \"SNOMEDCT:2016-03\": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2016-03'\r\n\r\nvalueset \"Emergency Department Visit\": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.292'\r\nvalueset \"Encounter Inpatient\": 'urn:oid:2.16.840.1.113883.3.666.5.307'\r\nvalueset \"Intensive Care Unit\": 'urn:oid:2.16.840.1.113762.1.4.1110.23'\r\n\r\ncode \"Birthdate\": '21112-8' from \"LOINC:2.46\" display 'Birth date'\r\ncode \"Dead\": '419099009' from \"SNOMEDCT:2016-03\" display 'Dead'\r\n\r\nparameter \"Measurement Period\" Interval<DateTime>\r\n\r\ncontext Patient\r\n\r\ndefine \"Encounter\":\r\n\t[\"Encounter, Performed\": \"Emergency Department Visit\"]\r\n\r\ndefine \"Inpatient Encounter\":\r\n\t[\"Encounter, Performed\": \"Encounter Inpatient\"] EncounterInpatient\r\n\t\twhere \"LengthInDays\"(EncounterInpatient.relevantPeriod)<= 120\r\n\t\t\tand EncounterInpatient.relevantPeriod ends during \"Measurement Period\"\n\n/*ToDate takes a given DateTime value and returns a DateTime with the time components \"zeroed\", and the timezone of the input value, for example, given the DateTime @2012-01-01T06:30:00.0Z, this function will return @2012-01-01T00:00:00.0Z.*/\r\n\r\ndefine function \"ToDate\"(Value DateTime):\r\n\tDateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezone from Value)\n\n/*CalendarAgeInDaysAt calculates the calendar age (meaning the age without considering time components) in days.*/\r\n\r\ndefine function \"CalendarAgeInDaysAt\"(BirthDateTime DateTime, AsOf DateTime):\r\n\tdays between ToDate(BirthDateTime)and ToDate(AsOf)\n\n/*CalendarAgeInDays calculates the calendar age (meaning the age without considering time components) in days as of today*/\r\n\r\ndefine function \"CalendarAgeInDays\"(BirthDateTime DateTime):\r\n\tCalendarAgeInDaysAt(BirthDateTime, Today())\n\n/*CalendarAgeInMonthsAt calculates the calendar age (meaning the age without considering time components) in months.*/\r\n\r\ndefine function \"CalendarAgeInMonthsAt\"(BirthDateTime DateTime, AsOf DateTime):\r\n\tmonths between ToDate(BirthDateTime)and ToDate(AsOf)\n\n/*CalendarAgeInMonths calculates the calendar age (meaning the age without considering time components) in months as of today.*/\r\n\r\ndefine function \"CalendarAgeInMonths\"(BirthDateTime DateTime):\r\n\tCalendarAgeInMonthsAt(BirthDateTime, Today())\n\n/*CalendarAgeInYearsAt calculates the calendar age (meaning the age without considering time components) in years.*/\r\n\r\ndefine function \"CalendarAgeInYearsAt\"(BirthDateTime DateTime, AsOf DateTime):\r\n\tyears between ToDate(BirthDateTime)and ToDate(AsOf)\n\n/*CalendarAgeInYears calculates the calendar age (meaning the age without considering time components) in years as of today.*/\r\n\r\ndefine function \"CalendarAgeInYears\"(BirthDateTime DateTime):\r\n\tCalendarAgeInYearsAt(BirthDateTime, Today())\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.*/\r\n\r\ndefine function \"Hospitalization\"(Encounter \"Encounter, Performed\"):\r\n\t( singleton from ( [\"Encounter, Performed\": \"Emergency Department Visit\"] EDVisit\r\n\t\t\twhere EDVisit.relevantPeriod ends 1 hour or less on or before start of Encounter.relevantPeriod\r\n\t) ) X\r\n\t\treturn if X is null then Encounter.relevantPeriod else Interval[start of X.relevantPeriod, end of Encounter.relevantPeriod]\n\n/*calculates the difference in calendar days between the start and end of the given interval.*/\r\n\r\ndefine function \"LengthInDays\"(Value Interval<DateTime>):\r\n\tdifference 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.  If data contains many encounters within 1 hour before the start of encounter error will occur indicating the hospitalization cannot be determined*/\r\n\r\ndefine function \"Hospitalization Locations\"(Encounter \"Encounter, Performed\"):\r\n\t( singleton from ( [\"Encounter, Performed\": \"Emergency Department Visit\"] EDVisit\r\n\t\t\twhere EDVisit.relevantPeriod ends 1 hour or less on or before start of Encounter.relevantPeriod\r\n\t) ) EDEncounter\r\n\t\treturn if EDEncounter is null then Encounter.facilityLocations else flatten { EDEncounter.facilityLocations, Encounter.facilityLocations }\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*/\r\n\r\ndefine function \"Hospitalization Length of Stay\"(Encounter \"Encounter, Performed\"):\r\n\tLengthInDays(\"Hospitalization\"(Encounter))\n\n/*Returns admission time for an encounter or for immediately prior emergency department visit.  If the data contain many encounters within 1 hour before the start of the encounter an error indicating hospitalization cannot be determined\n*/\r\n\r\ndefine function \"Hospital Admission Time\"(Encounter \"Encounter, Performed\"):\r\n\tstart of \"Hospitalization\"(Encounter)\n\n/*Hospital Discharge Time returns the discharge time for an encounter*/\r\n\r\ndefine function \"Hospital Discharge Time\"(Encounter \"Encounter, Performed\"):\r\n\tend of Encounter.relevantPeriod\n\n/*Returns earliest arrival time for an encounter including any prior ED visit. If the data contain multiple encounters within 1 hour before the start of the encounter, an error will occur indicating it cannot be unambiguously determined\n*/\r\n\r\ndefine function \"Hospital Arrival Time\"(Encounter \"Encounter, Performed\"):\r\n\tstart of First((\"Hospitalization Locations\"(Encounter))HospitalLocation\r\n\t\t\tsort by start of locationPeriod\r\n\t).locationPeriod\n\n/*Returns the latest departure time for encounter including any prior ED visit. If the data contain multiple encounters within 1 hour before the start of the encounter, an error will occur indicating it cannot be unambiguously determined*/\r\n\r\ndefine function \"Hospital Departure Time\"(Encounter \"Encounter, Performed\"):\r\n\tend of Last((\"Hospitalization Locations\"(Encounter))HospitalLocation\r\n\t\t\tsort by start of locationPeriod\r\n\t).locationPeriod\n\n/*Returns the arrival time in the ED for the encounter.  If the data contain multiple encounters within 1 hour before the start of the encounter or multiple ED locations an error will occur indicating it cannot be determined\n*/\r\n\r\ndefine function \"Emergency Department Arrival Time\"(Encounter \"Encounter, Performed\"):\r\n\tstart of ( singleton from ( ( \"Hospitalization Locations\"(Encounter)) HospitalLocation\r\n\t\t\t\twhere HospitalLocation.code in \"Emergency Department Visit\"\r\n\t\t)\r\n\t).locationPeriod\n\n/*First Inpatient Intensive Care Unit returns the first intensive care unit for\nthe given encounter, without considering any immediately prior emergency\ndepartment visit.*/\r\n\r\ndefine function \"First Inpatient Intensive Care Unit\"(Encounter \"Encounter, Performed\"):\r\n\tFirst((Encounter.facilityLocations)HospitalLocation\r\n\t\t\twhere HospitalLocation.code in \"Intensive Care Unit\"\r\n\t\t\t\tand HospitalLocation.locationPeriod during Encounter.relevantPeriod\r\n\t\t\tsort by start of locationPeriod\r\n\t)\r\n",
      "elm": {
        "library": {
          "identifier": {
            "id": "MATGlobalCommonFunctions",
            "version": "2.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_3",
                "version": "5.3"
              }
            ]
          },
          "parameters": {
            "def": [
              {
                "localId": "13",
                "locator": "15:1-15:49",
                "name": "Measurement Period",
                "accessLevel": "Public",
                "parameterTypeSpecifier": {
                  "localId": "12",
                  "locator": "15:32-15:49",
                  "type": "IntervalTypeSpecifier",
                  "pointType": {
                    "localId": "11",
                    "locator": "15:41-15:48",
                    "name": "{urn:hl7-org:elm-types:r1}DateTime",
                    "type": "NamedTypeSpecifier"
                  }
                }
              }
            ]
          },
          "codeSystems": {
            "def": [
              {
                "localId": "2",
                "locator": "5:1-5:87",
                "name": "LOINC:2.46",
                "id": "2.16.840.1.113883.6.1",
                "version": "urn:hl7:version:2.46",
                "accessLevel": "Public"
              },
              {
                "localId": "3",
                "locator": "6:1-6:97",
                "name": "SNOMEDCT:2016-03",
                "id": "2.16.840.1.113883.6.96",
                "version": "urn:hl7:version:2016-03",
                "accessLevel": "Public"
              }
            ]
          },
          "valueSets": {
            "def": [
              {
                "localId": "4",
                "locator": "8:1-8:82",
                "name": "Emergency Department Visit",
                "id": "2.16.840.1.113883.3.117.1.7.1.292",
                "accessLevel": "Public"
              },
              {
                "localId": "5",
                "locator": "9:1-9:71",
                "name": "Encounter Inpatient",
                "id": "2.16.840.1.113883.3.666.5.307",
                "accessLevel": "Public"
              },
              {
                "localId": "6",
                "locator": "10:1-10:71",
                "name": "Intensive Care Unit",
                "id": "2.16.840.1.113762.1.4.1110.23",
                "accessLevel": "Public"
              }
            ]
          },
          "codes": {
            "def": [
              {
                "localId": "8",
                "locator": "12:1-12:66",
                "name": "Birthdate",
                "id": "21112-8",
                "display": "Birth date",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "7",
                  "locator": "12:34-12:45",
                  "name": "LOINC:2.46"
                }
              },
              {
                "localId": "10",
                "locator": "13:1-13:63",
                "name": "Dead",
                "id": "419099009",
                "display": "Dead",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "9",
                  "locator": "13:31-13:48",
                  "name": "SNOMEDCT:2016-03"
                }
              }
            ]
          },
          "statements": {
            "def": [
              {
                "locator": "17:1-17:15",
                "name": "Patient",
                "context": "Patient",
                "expression": {
                  "type": "SingletonFrom",
                  "operand": {
                    "locator": "17:1-17:15",
                    "dataType": "{urn:healthit-gov:qdm:v5_3}Patient",
                    "templateId": "Patient",
                    "type": "Retrieve"
                  }
                }
              },
              {
                "localId": "15",
                "locator": "19:1-20:55",
                "name": "Encounter",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "15",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Encounter\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "14",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Encounter, Performed\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Emergency Department Visit\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "14",
                  "locator": "20:2-20:55",
                  "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                  "templateId": "PositiveEncounterPerformed",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "name": "Emergency Department Visit",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "27",
                "locator": "63:1-64:59",
                "name": "LengthInDays",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "27",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"LengthInDays\"",
                            "(",
                            "Value",
                            " "
                          ]
                        },
                        {
                          "r": "21",
                          "s": [
                            {
                              "value": [
                                "Interval<"
                              ]
                            },
                            {
                              "r": "20",
                              "s": [
                                {
                                  "value": [
                                    "DateTime"
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                ">"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "26",
                          "s": [
                            {
                              "r": "26",
                              "s": [
                                {
                                  "value": [
                                    "difference in days between "
                                  ]
                                },
                                {
                                  "r": "23",
                                  "s": [
                                    {
                                      "value": [
                                        "start of "
                                      ]
                                    },
                                    {
                                      "r": "22",
                                      "s": [
                                        {
                                          "value": [
                                            "Value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    " and "
                                  ]
                                },
                                {
                                  "r": "25",
                                  "s": [
                                    {
                                      "value": [
                                        "end of "
                                      ]
                                    },
                                    {
                                      "r": "24",
                                      "s": [
                                        {
                                          "value": [
                                            "Value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "26",
                  "locator": "64:2-64:59",
                  "precision": "Day",
                  "type": "DifferenceBetween",
                  "operand": [
                    {
                      "localId": "23",
                      "locator": "64:29-64:42",
                      "type": "Start",
                      "operand": {
                        "localId": "22",
                        "locator": "64:38-64:42",
                        "name": "Value",
                        "type": "OperandRef"
                      }
                    },
                    {
                      "localId": "25",
                      "locator": "64:48-64:59",
                      "type": "End",
                      "operand": {
                        "localId": "24",
                        "locator": "64:55-64:59",
                        "name": "Value",
                        "type": "OperandRef"
                      }
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "Value",
                    "operandTypeSpecifier": {
                      "localId": "21",
                      "locator": "63:38-63:55",
                      "type": "IntervalTypeSpecifier",
                      "pointType": {
                        "localId": "20",
                        "locator": "63:47-63:54",
                        "name": "{urn:hl7-org:elm-types:r1}DateTime",
                        "type": "NamedTypeSpecifier"
                      }
                    }
                  }
                ]
              },
              {
                "localId": "37",
                "locator": "22:1-25:73",
                "name": "Inpatient Encounter",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "37",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Inpatient Encounter\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "36",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "17",
                                  "s": [
                                    {
                                      "r": "16",
                                      "s": [
                                        {
                                          "r": "16",
                                          "s": [
                                            {
                                              "value": [
                                                "[",
                                                "\"Encounter, Performed\"",
                                                ": "
                                              ]
                                            },
                                            {
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Encounter Inpatient\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "]"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EncounterInpatient"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t\t"
                              ]
                            },
                            {
                              "r": "35",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "35",
                                  "s": [
                                    {
                                      "r": "30",
                                      "s": [
                                        {
                                          "r": "28",
                                          "s": [
                                            {
                                              "value": [
                                                "\"LengthInDays\"",
                                                "("
                                              ]
                                            },
                                            {
                                              "r": "19",
                                              "s": [
                                                {
                                                  "r": "18",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "EncounterInpatient"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "19",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "relevantPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ")"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "<=",
                                            " ",
                                            "120"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\tand "
                                      ]
                                    },
                                    {
                                      "r": "34",
                                      "s": [
                                        {
                                          "r": "32",
                                          "s": [
                                            {
                                              "r": "31",
                                              "s": [
                                                {
                                                  "value": [
                                                    "EncounterInpatient"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "."
                                              ]
                                            },
                                            {
                                              "r": "32",
                                              "s": [
                                                {
                                                  "value": [
                                                    "relevantPeriod"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "ends during",
                                            " "
                                          ]
                                        },
                                        {
                                          "r": "33",
                                          "s": [
                                            {
                                              "value": [
                                                "\"Measurement Period\""
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "36",
                  "locator": "23:2-25:73",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "17",
                      "locator": "23:2-23:67",
                      "alias": "EncounterInpatient",
                      "expression": {
                        "localId": "16",
                        "locator": "23:2-23:48",
                        "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                        "templateId": "PositiveEncounterPerformed",
                        "codeProperty": "code",
                        "type": "Retrieve",
                        "codes": {
                          "name": "Encounter Inpatient",
                          "type": "ValueSetRef"
                        }
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "35",
                    "locator": "24:3-25:73",
                    "type": "And",
                    "operand": [
                      {
                        "localId": "30",
                        "locator": "24:9-24:63",
                        "type": "LessOrEqual",
                        "operand": [
                          {
                            "localId": "28",
                            "locator": "24:9-24:57",
                            "name": "LengthInDays",
                            "type": "FunctionRef",
                            "operand": [
                              {
                                "localId": "19",
                                "locator": "24:24-24:56",
                                "path": "relevantPeriod",
                                "scope": "EncounterInpatient",
                                "type": "Property"
                              }
                            ]
                          },
                          {
                            "localId": "29",
                            "locator": "24:61-24:63",
                            "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                            "value": "120",
                            "type": "Literal"
                          }
                        ]
                      },
                      {
                        "localId": "34",
                        "locator": "25:8-25:73",
                        "type": "In",
                        "operand": [
                          {
                            "locator": "25:42-25:45",
                            "type": "End",
                            "operand": {
                              "localId": "32",
                              "locator": "25:8-25:40",
                              "path": "relevantPeriod",
                              "scope": "EncounterInpatient",
                              "type": "Property"
                            }
                          },
                          {
                            "localId": "33",
                            "locator": "25:54-25:73",
                            "name": "Measurement Period",
                            "type": "ParameterRef"
                          }
                        ]
                      }
                    ]
                  }
                }
              },
              {
                "localId": "52",
                "locator": "28:1-29:93",
                "name": "ToDate",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "52",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"ToDate\"",
                            "(",
                            "Value",
                            " "
                          ]
                        },
                        {
                          "r": "38",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "51",
                          "s": [
                            {
                              "r": "51",
                              "s": [
                                {
                                  "value": [
                                    "DateTime",
                                    "("
                                  ]
                                },
                                {
                                  "r": "40",
                                  "s": [
                                    {
                                      "value": [
                                        "year from "
                                      ]
                                    },
                                    {
                                      "r": "39",
                                      "s": [
                                        {
                                          "value": [
                                            "Value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ", "
                                  ]
                                },
                                {
                                  "r": "42",
                                  "s": [
                                    {
                                      "value": [
                                        "month from "
                                      ]
                                    },
                                    {
                                      "r": "41",
                                      "s": [
                                        {
                                          "value": [
                                            "Value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ", "
                                  ]
                                },
                                {
                                  "r": "44",
                                  "s": [
                                    {
                                      "value": [
                                        "day from "
                                      ]
                                    },
                                    {
                                      "r": "43",
                                      "s": [
                                        {
                                          "value": [
                                            "Value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ", ",
                                    "0",
                                    ", ",
                                    "0",
                                    ", ",
                                    "0",
                                    ", ",
                                    "0",
                                    ", "
                                  ]
                                },
                                {
                                  "r": "50",
                                  "s": [
                                    {
                                      "value": [
                                        "timezone from "
                                      ]
                                    },
                                    {
                                      "r": "49",
                                      "s": [
                                        {
                                          "value": [
                                            "Value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ")"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "51",
                  "locator": "29:2-29:93",
                  "type": "DateTime",
                  "year": {
                    "localId": "40",
                    "locator": "29:11-29:25",
                    "precision": "Year",
                    "type": "DateTimeComponentFrom",
                    "operand": {
                      "localId": "39",
                      "locator": "29:21-29:25",
                      "name": "Value",
                      "type": "OperandRef"
                    }
                  },
                  "month": {
                    "localId": "42",
                    "locator": "29:28-29:43",
                    "precision": "Month",
                    "type": "DateTimeComponentFrom",
                    "operand": {
                      "localId": "41",
                      "locator": "29:39-29:43",
                      "name": "Value",
                      "type": "OperandRef"
                    }
                  },
                  "day": {
                    "localId": "44",
                    "locator": "29:46-29:59",
                    "precision": "Day",
                    "type": "DateTimeComponentFrom",
                    "operand": {
                      "localId": "43",
                      "locator": "29:55-29:59",
                      "name": "Value",
                      "type": "OperandRef"
                    }
                  },
                  "hour": {
                    "localId": "45",
                    "locator": "29:62",
                    "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                    "value": "0",
                    "type": "Literal"
                  },
                  "minute": {
                    "localId": "46",
                    "locator": "29:65",
                    "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                    "value": "0",
                    "type": "Literal"
                  },
                  "second": {
                    "localId": "47",
                    "locator": "29:68",
                    "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                    "value": "0",
                    "type": "Literal"
                  },
                  "millisecond": {
                    "localId": "48",
                    "locator": "29:71",
                    "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                    "value": "0",
                    "type": "Literal"
                  },
                  "timezoneOffset": {
                    "localId": "50",
                    "locator": "29:74-29:92",
                    "type": "TimezoneFrom",
                    "operand": {
                      "localId": "49",
                      "locator": "29:88-29:92",
                      "name": "Value",
                      "type": "OperandRef"
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Value",
                    "operandTypeSpecifier": {
                      "localId": "38",
                      "locator": "28:32-28:39",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "60",
                "locator": "32:1-33:51",
                "name": "CalendarAgeInDaysAt",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "60",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"CalendarAgeInDaysAt\"",
                            "(",
                            "BirthDateTime",
                            " "
                          ]
                        },
                        {
                          "r": "53",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            ", ",
                            "AsOf",
                            " "
                          ]
                        },
                        {
                          "r": "54",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "59",
                          "s": [
                            {
                              "r": "59",
                              "s": [
                                {
                                  "value": [
                                    "days between "
                                  ]
                                },
                                {
                                  "r": "56",
                                  "s": [
                                    {
                                      "value": [
                                        "ToDate",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "55",
                                      "s": [
                                        {
                                          "value": [
                                            "BirthDateTime"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "and "
                                  ]
                                },
                                {
                                  "r": "58",
                                  "s": [
                                    {
                                      "value": [
                                        "ToDate",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "57",
                                      "s": [
                                        {
                                          "value": [
                                            "AsOf"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "59",
                  "locator": "33:2-33:51",
                  "precision": "Day",
                  "type": "DurationBetween",
                  "operand": [
                    {
                      "localId": "56",
                      "locator": "33:15-33:35",
                      "name": "ToDate",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "55",
                          "locator": "33:22-33:34",
                          "name": "BirthDateTime",
                          "type": "OperandRef"
                        }
                      ]
                    },
                    {
                      "localId": "58",
                      "locator": "33:40-33:51",
                      "name": "ToDate",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "57",
                          "locator": "33:47-33:50",
                          "name": "AsOf",
                          "type": "OperandRef"
                        }
                      ]
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "BirthDateTime",
                    "operandTypeSpecifier": {
                      "localId": "53",
                      "locator": "32:53-32:60",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  },
                  {
                    "name": "AsOf",
                    "operandTypeSpecifier": {
                      "localId": "54",
                      "locator": "32:68-32:75",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "65",
                "locator": "36:1-37:44",
                "name": "CalendarAgeInDays",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "65",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"CalendarAgeInDays\"",
                            "(",
                            "BirthDateTime",
                            " "
                          ]
                        },
                        {
                          "r": "61",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "64",
                          "s": [
                            {
                              "r": "64",
                              "s": [
                                {
                                  "value": [
                                    "CalendarAgeInDaysAt",
                                    "("
                                  ]
                                },
                                {
                                  "r": "62",
                                  "s": [
                                    {
                                      "value": [
                                        "BirthDateTime"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ", "
                                  ]
                                },
                                {
                                  "r": "63",
                                  "s": [
                                    {
                                      "value": [
                                        "Today",
                                        "()"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ")"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "64",
                  "locator": "37:2-37:44",
                  "name": "CalendarAgeInDaysAt",
                  "type": "FunctionRef",
                  "operand": [
                    {
                      "localId": "62",
                      "locator": "37:22-37:34",
                      "name": "BirthDateTime",
                      "type": "OperandRef"
                    },
                    {
                      "localId": "63",
                      "locator": "37:37-37:43",
                      "type": "Today"
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "BirthDateTime",
                    "operandTypeSpecifier": {
                      "localId": "61",
                      "locator": "36:51-36:58",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "73",
                "locator": "40:1-41:53",
                "name": "CalendarAgeInMonthsAt",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "73",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"CalendarAgeInMonthsAt\"",
                            "(",
                            "BirthDateTime",
                            " "
                          ]
                        },
                        {
                          "r": "66",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            ", ",
                            "AsOf",
                            " "
                          ]
                        },
                        {
                          "r": "67",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "72",
                          "s": [
                            {
                              "r": "72",
                              "s": [
                                {
                                  "value": [
                                    "months between "
                                  ]
                                },
                                {
                                  "r": "69",
                                  "s": [
                                    {
                                      "value": [
                                        "ToDate",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "68",
                                      "s": [
                                        {
                                          "value": [
                                            "BirthDateTime"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "and "
                                  ]
                                },
                                {
                                  "r": "71",
                                  "s": [
                                    {
                                      "value": [
                                        "ToDate",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "70",
                                      "s": [
                                        {
                                          "value": [
                                            "AsOf"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "72",
                  "locator": "41:2-41:53",
                  "precision": "Month",
                  "type": "DurationBetween",
                  "operand": [
                    {
                      "localId": "69",
                      "locator": "41:17-41:37",
                      "name": "ToDate",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "68",
                          "locator": "41:24-41:36",
                          "name": "BirthDateTime",
                          "type": "OperandRef"
                        }
                      ]
                    },
                    {
                      "localId": "71",
                      "locator": "41:42-41:53",
                      "name": "ToDate",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "70",
                          "locator": "41:49-41:52",
                          "name": "AsOf",
                          "type": "OperandRef"
                        }
                      ]
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "BirthDateTime",
                    "operandTypeSpecifier": {
                      "localId": "66",
                      "locator": "40:55-40:62",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  },
                  {
                    "name": "AsOf",
                    "operandTypeSpecifier": {
                      "localId": "67",
                      "locator": "40:70-40:77",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "78",
                "locator": "44:1-45:46",
                "name": "CalendarAgeInMonths",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "78",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"CalendarAgeInMonths\"",
                            "(",
                            "BirthDateTime",
                            " "
                          ]
                        },
                        {
                          "r": "74",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "77",
                          "s": [
                            {
                              "r": "77",
                              "s": [
                                {
                                  "value": [
                                    "CalendarAgeInMonthsAt",
                                    "("
                                  ]
                                },
                                {
                                  "r": "75",
                                  "s": [
                                    {
                                      "value": [
                                        "BirthDateTime"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ", "
                                  ]
                                },
                                {
                                  "r": "76",
                                  "s": [
                                    {
                                      "value": [
                                        "Today",
                                        "()"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ")"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "77",
                  "locator": "45:2-45:46",
                  "name": "CalendarAgeInMonthsAt",
                  "type": "FunctionRef",
                  "operand": [
                    {
                      "localId": "75",
                      "locator": "45:24-45:36",
                      "name": "BirthDateTime",
                      "type": "OperandRef"
                    },
                    {
                      "localId": "76",
                      "locator": "45:39-45:45",
                      "type": "Today"
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "BirthDateTime",
                    "operandTypeSpecifier": {
                      "localId": "74",
                      "locator": "44:53-44:60",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "86",
                "locator": "48:1-49:52",
                "name": "CalendarAgeInYearsAt",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "86",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"CalendarAgeInYearsAt\"",
                            "(",
                            "BirthDateTime",
                            " "
                          ]
                        },
                        {
                          "r": "79",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            ", ",
                            "AsOf",
                            " "
                          ]
                        },
                        {
                          "r": "80",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "85",
                          "s": [
                            {
                              "r": "85",
                              "s": [
                                {
                                  "value": [
                                    "years between "
                                  ]
                                },
                                {
                                  "r": "82",
                                  "s": [
                                    {
                                      "value": [
                                        "ToDate",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "81",
                                      "s": [
                                        {
                                          "value": [
                                            "BirthDateTime"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "and "
                                  ]
                                },
                                {
                                  "r": "84",
                                  "s": [
                                    {
                                      "value": [
                                        "ToDate",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "83",
                                      "s": [
                                        {
                                          "value": [
                                            "AsOf"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "85",
                  "locator": "49:2-49:52",
                  "precision": "Year",
                  "type": "DurationBetween",
                  "operand": [
                    {
                      "localId": "82",
                      "locator": "49:16-49:36",
                      "name": "ToDate",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "81",
                          "locator": "49:23-49:35",
                          "name": "BirthDateTime",
                          "type": "OperandRef"
                        }
                      ]
                    },
                    {
                      "localId": "84",
                      "locator": "49:41-49:52",
                      "name": "ToDate",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "83",
                          "locator": "49:48-49:51",
                          "name": "AsOf",
                          "type": "OperandRef"
                        }
                      ]
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "BirthDateTime",
                    "operandTypeSpecifier": {
                      "localId": "79",
                      "locator": "48:54-48:61",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  },
                  {
                    "name": "AsOf",
                    "operandTypeSpecifier": {
                      "localId": "80",
                      "locator": "48:69-48:76",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "91",
                "locator": "52:1-53:45",
                "name": "CalendarAgeInYears",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "91",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"CalendarAgeInYears\"",
                            "(",
                            "BirthDateTime",
                            " "
                          ]
                        },
                        {
                          "r": "87",
                          "s": [
                            {
                              "value": [
                                "DateTime"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "90",
                          "s": [
                            {
                              "r": "90",
                              "s": [
                                {
                                  "value": [
                                    "CalendarAgeInYearsAt",
                                    "("
                                  ]
                                },
                                {
                                  "r": "88",
                                  "s": [
                                    {
                                      "value": [
                                        "BirthDateTime"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ", "
                                  ]
                                },
                                {
                                  "r": "89",
                                  "s": [
                                    {
                                      "value": [
                                        "Today",
                                        "()"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ")"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "90",
                  "locator": "53:2-53:45",
                  "name": "CalendarAgeInYearsAt",
                  "type": "FunctionRef",
                  "operand": [
                    {
                      "localId": "88",
                      "locator": "53:23-53:35",
                      "name": "BirthDateTime",
                      "type": "OperandRef"
                    },
                    {
                      "localId": "89",
                      "locator": "53:38-53:44",
                      "type": "Today"
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "BirthDateTime",
                    "operandTypeSpecifier": {
                      "localId": "87",
                      "locator": "52:52-52:59",
                      "name": "{urn:hl7-org:elm-types:r1}DateTime",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "119",
                "locator": "56:1-60:125",
                "name": "Hospitalization",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "119",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospitalization\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "92",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "118",
                          "s": [
                            {
                              "r": "118",
                              "s": [
                                {
                                  "s": [
                                    {
                                      "r": "104",
                                      "s": [
                                        {
                                          "r": "103",
                                          "s": [
                                            {
                                              "value": [
                                                "( "
                                              ]
                                            },
                                            {
                                              "r": "103",
                                              "s": [
                                                {
                                                  "value": [
                                                    "singleton from "
                                                  ]
                                                },
                                                {
                                                  "r": "102",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "( "
                                                      ]
                                                    },
                                                    {
                                                      "r": "102",
                                                      "s": [
                                                        {
                                                          "s": [
                                                            {
                                                              "r": "94",
                                                              "s": [
                                                                {
                                                                  "r": "93",
                                                                  "s": [
                                                                    {
                                                                      "r": "93",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "[",
                                                                            "\"Encounter, Performed\"",
                                                                            ": "
                                                                          ]
                                                                        },
                                                                        {
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "\"Emergency Department Visit\""
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "]"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " ",
                                                                    "EDVisit"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "\n\t\t\t"
                                                          ]
                                                        },
                                                        {
                                                          "r": "101",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "where "
                                                              ]
                                                            },
                                                            {
                                                              "r": "101",
                                                              "s": [
                                                                {
                                                                  "r": "96",
                                                                  "s": [
                                                                    {
                                                                      "r": "95",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "EDVisit"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "."
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "96",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "relevantPeriod"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "101",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "ends "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "100",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "1 ",
                                                                            "hour"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        " or less on or before"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "99",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "start of "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "98",
                                                                      "s": [
                                                                        {
                                                                          "r": "97",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "Encounter"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "98",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "relevantPeriod"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n\t)"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " )"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "X"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t"
                                  ]
                                },
                                {
                                  "r": "117",
                                  "s": [
                                    {
                                      "value": [
                                        "return "
                                      ]
                                    },
                                    {
                                      "r": "116",
                                      "s": [
                                        {
                                          "value": [
                                            "if "
                                          ]
                                        },
                                        {
                                          "r": "106",
                                          "s": [
                                            {
                                              "r": "105",
                                              "s": [
                                                {
                                                  "value": [
                                                    "X"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " is null"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " then "
                                          ]
                                        },
                                        {
                                          "r": "108",
                                          "s": [
                                            {
                                              "r": "107",
                                              "s": [
                                                {
                                                  "value": [
                                                    "Encounter"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "."
                                              ]
                                            },
                                            {
                                              "r": "108",
                                              "s": [
                                                {
                                                  "value": [
                                                    "relevantPeriod"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " else "
                                          ]
                                        },
                                        {
                                          "r": "115",
                                          "s": [
                                            {
                                              "value": [
                                                "Interval["
                                              ]
                                            },
                                            {
                                              "r": "111",
                                              "s": [
                                                {
                                                  "value": [
                                                    "start of "
                                                  ]
                                                },
                                                {
                                                  "r": "110",
                                                  "s": [
                                                    {
                                                      "r": "109",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "X"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "110",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "relevantPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ", "
                                              ]
                                            },
                                            {
                                              "r": "114",
                                              "s": [
                                                {
                                                  "value": [
                                                    "end of "
                                                  ]
                                                },
                                                {
                                                  "r": "113",
                                                  "s": [
                                                    {
                                                      "r": "112",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Encounter"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "113",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "relevantPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "]"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "118",
                  "locator": "57:2-60:125",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "104",
                      "locator": "57:2-59:6",
                      "alias": "X",
                      "expression": {
                        "localId": "103",
                        "locator": "57:2-59:4",
                        "type": "SingletonFrom",
                        "operand": {
                          "localId": "102",
                          "locator": "57:19-59:2",
                          "type": "Query",
                          "source": [
                            {
                              "localId": "94",
                              "locator": "57:21-57:82",
                              "alias": "EDVisit",
                              "expression": {
                                "localId": "93",
                                "locator": "57:21-57:74",
                                "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                "templateId": "PositiveEncounterPerformed",
                                "codeProperty": "code",
                                "type": "Retrieve",
                                "codes": {
                                  "name": "Emergency Department Visit",
                                  "type": "ValueSetRef"
                                }
                              }
                            }
                          ],
                          "relationship": [

                          ],
                          "where": {
                            "localId": "101",
                            "locator": "58:4-58:98",
                            "type": "In",
                            "operand": [
                              {
                                "locator": "58:33-58:36",
                                "type": "End",
                                "operand": {
                                  "localId": "96",
                                  "locator": "58:10-58:31",
                                  "path": "relevantPeriod",
                                  "scope": "EDVisit",
                                  "type": "Property"
                                }
                              },
                              {
                                "locator": "58:38-58:51",
                                "lowClosed": true,
                                "highClosed": true,
                                "type": "Interval",
                                "low": {
                                  "locator": "58:66-58:98",
                                  "type": "Subtract",
                                  "operand": [
                                    {
                                      "localId": "99",
                                      "locator": "58:66-58:98",
                                      "type": "Start",
                                      "operand": {
                                        "localId": "98",
                                        "locator": "58:75-58:98",
                                        "path": "relevantPeriod",
                                        "type": "Property",
                                        "source": {
                                          "localId": "97",
                                          "locator": "58:75-58:83",
                                          "name": "Encounter",
                                          "type": "OperandRef"
                                        }
                                      }
                                    },
                                    {
                                      "localId": "100",
                                      "locator": "58:38-58:43",
                                      "value": 1,
                                      "unit": "hour",
                                      "type": "Quantity"
                                    }
                                  ]
                                },
                                "high": {
                                  "localId": "99",
                                  "locator": "58:66-58:98",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "98",
                                    "locator": "58:75-58:98",
                                    "path": "relevantPeriod",
                                    "type": "Property",
                                    "source": {
                                      "localId": "97",
                                      "locator": "58:75-58:83",
                                      "name": "Encounter",
                                      "type": "OperandRef"
                                    }
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "return": {
                    "localId": "117",
                    "locator": "60:3-60:125",
                    "expression": {
                      "localId": "116",
                      "locator": "60:10-60:125",
                      "type": "If",
                      "condition": {
                        "asType": "{urn:hl7-org:elm-types:r1}Boolean",
                        "type": "As",
                        "operand": {
                          "localId": "106",
                          "locator": "60:13-60:21",
                          "type": "IsNull",
                          "operand": {
                            "localId": "105",
                            "locator": "60:13",
                            "name": "X",
                            "type": "AliasRef"
                          }
                        },
                        "asTypeSpecifier": {
                          "name": "{urn:hl7-org:elm-types:r1}Boolean",
                          "type": "NamedTypeSpecifier"
                        }
                      },
                      "then": {
                        "localId": "108",
                        "locator": "60:28-60:51",
                        "path": "relevantPeriod",
                        "type": "Property",
                        "source": {
                          "localId": "107",
                          "locator": "60:28-60:36",
                          "name": "Encounter",
                          "type": "OperandRef"
                        }
                      },
                      "else": {
                        "localId": "115",
                        "locator": "60:58-60:125",
                        "lowClosed": true,
                        "highClosed": true,
                        "type": "Interval",
                        "low": {
                          "localId": "111",
                          "locator": "60:67-60:91",
                          "type": "Start",
                          "operand": {
                            "localId": "110",
                            "locator": "60:76-60:91",
                            "path": "relevantPeriod",
                            "scope": "X",
                            "type": "Property"
                          }
                        },
                        "high": {
                          "localId": "114",
                          "locator": "60:94-60:124",
                          "type": "End",
                          "operand": {
                            "localId": "113",
                            "locator": "60:101-60:124",
                            "path": "relevantPeriod",
                            "type": "Property",
                            "source": {
                              "localId": "112",
                              "locator": "60:101-60:109",
                              "name": "Encounter",
                              "type": "OperandRef"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "92",
                      "locator": "56:45-56:66",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "149",
                "locator": "67:1-71:140",
                "name": "Hospitalization Locations",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "149",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospitalization Locations\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "123",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "148",
                          "s": [
                            {
                              "r": "148",
                              "s": [
                                {
                                  "s": [
                                    {
                                      "r": "135",
                                      "s": [
                                        {
                                          "r": "134",
                                          "s": [
                                            {
                                              "value": [
                                                "( "
                                              ]
                                            },
                                            {
                                              "r": "134",
                                              "s": [
                                                {
                                                  "value": [
                                                    "singleton from "
                                                  ]
                                                },
                                                {
                                                  "r": "133",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "( "
                                                      ]
                                                    },
                                                    {
                                                      "r": "133",
                                                      "s": [
                                                        {
                                                          "s": [
                                                            {
                                                              "r": "125",
                                                              "s": [
                                                                {
                                                                  "r": "124",
                                                                  "s": [
                                                                    {
                                                                      "r": "124",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "[",
                                                                            "\"Encounter, Performed\"",
                                                                            ": "
                                                                          ]
                                                                        },
                                                                        {
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "\"Emergency Department Visit\""
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "]"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " ",
                                                                    "EDVisit"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "\n\t\t\t"
                                                          ]
                                                        },
                                                        {
                                                          "r": "132",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "where "
                                                              ]
                                                            },
                                                            {
                                                              "r": "132",
                                                              "s": [
                                                                {
                                                                  "r": "127",
                                                                  "s": [
                                                                    {
                                                                      "r": "126",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "EDVisit"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "."
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "127",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "relevantPeriod"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "132",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "ends "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "131",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "1 ",
                                                                            "hour"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        " or less on or before"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "130",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "start of "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "129",
                                                                      "s": [
                                                                        {
                                                                          "r": "128",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "Encounter"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "129",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "relevantPeriod"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n\t)"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " )"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "EDEncounter"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\t"
                                  ]
                                },
                                {
                                  "r": "147",
                                  "s": [
                                    {
                                      "value": [
                                        "return "
                                      ]
                                    },
                                    {
                                      "r": "146",
                                      "s": [
                                        {
                                          "value": [
                                            "if "
                                          ]
                                        },
                                        {
                                          "r": "137",
                                          "s": [
                                            {
                                              "r": "136",
                                              "s": [
                                                {
                                                  "value": [
                                                    "EDEncounter"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " is null"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " then "
                                          ]
                                        },
                                        {
                                          "r": "139",
                                          "s": [
                                            {
                                              "r": "138",
                                              "s": [
                                                {
                                                  "value": [
                                                    "Encounter"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "."
                                              ]
                                            },
                                            {
                                              "r": "139",
                                              "s": [
                                                {
                                                  "value": [
                                                    "facilityLocations"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " else "
                                          ]
                                        },
                                        {
                                          "r": "145",
                                          "s": [
                                            {
                                              "value": [
                                                "flatten "
                                              ]
                                            },
                                            {
                                              "r": "144",
                                              "s": [
                                                {
                                                  "value": [
                                                    "{ "
                                                  ]
                                                },
                                                {
                                                  "r": "141",
                                                  "s": [
                                                    {
                                                      "r": "140",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "EDEncounter"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "141",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "facilityLocations"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    ", "
                                                  ]
                                                },
                                                {
                                                  "r": "143",
                                                  "s": [
                                                    {
                                                      "r": "142",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Encounter"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "143",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "facilityLocations"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " }"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "148",
                  "locator": "68:2-71:140",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "135",
                      "locator": "68:2-70:16",
                      "alias": "EDEncounter",
                      "expression": {
                        "localId": "134",
                        "locator": "68:2-70:4",
                        "type": "SingletonFrom",
                        "operand": {
                          "localId": "133",
                          "locator": "68:19-70:2",
                          "type": "Query",
                          "source": [
                            {
                              "localId": "125",
                              "locator": "68:21-68:82",
                              "alias": "EDVisit",
                              "expression": {
                                "localId": "124",
                                "locator": "68:21-68:74",
                                "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                "templateId": "PositiveEncounterPerformed",
                                "codeProperty": "code",
                                "type": "Retrieve",
                                "codes": {
                                  "name": "Emergency Department Visit",
                                  "type": "ValueSetRef"
                                }
                              }
                            }
                          ],
                          "relationship": [

                          ],
                          "where": {
                            "localId": "132",
                            "locator": "69:4-69:98",
                            "type": "In",
                            "operand": [
                              {
                                "locator": "69:33-69:36",
                                "type": "End",
                                "operand": {
                                  "localId": "127",
                                  "locator": "69:10-69:31",
                                  "path": "relevantPeriod",
                                  "scope": "EDVisit",
                                  "type": "Property"
                                }
                              },
                              {
                                "locator": "69:38-69:51",
                                "lowClosed": true,
                                "highClosed": true,
                                "type": "Interval",
                                "low": {
                                  "locator": "69:66-69:98",
                                  "type": "Subtract",
                                  "operand": [
                                    {
                                      "localId": "130",
                                      "locator": "69:66-69:98",
                                      "type": "Start",
                                      "operand": {
                                        "localId": "129",
                                        "locator": "69:75-69:98",
                                        "path": "relevantPeriod",
                                        "type": "Property",
                                        "source": {
                                          "localId": "128",
                                          "locator": "69:75-69:83",
                                          "name": "Encounter",
                                          "type": "OperandRef"
                                        }
                                      }
                                    },
                                    {
                                      "localId": "131",
                                      "locator": "69:38-69:43",
                                      "value": 1,
                                      "unit": "hour",
                                      "type": "Quantity"
                                    }
                                  ]
                                },
                                "high": {
                                  "localId": "130",
                                  "locator": "69:66-69:98",
                                  "type": "Start",
                                  "operand": {
                                    "localId": "129",
                                    "locator": "69:75-69:98",
                                    "path": "relevantPeriod",
                                    "type": "Property",
                                    "source": {
                                      "localId": "128",
                                      "locator": "69:75-69:83",
                                      "name": "Encounter",
                                      "type": "OperandRef"
                                    }
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "return": {
                    "localId": "147",
                    "locator": "71:3-71:140",
                    "expression": {
                      "localId": "146",
                      "locator": "71:10-71:140",
                      "type": "If",
                      "condition": {
                        "asType": "{urn:hl7-org:elm-types:r1}Boolean",
                        "type": "As",
                        "operand": {
                          "localId": "137",
                          "locator": "71:13-71:31",
                          "type": "IsNull",
                          "operand": {
                            "localId": "136",
                            "locator": "71:13-71:23",
                            "name": "EDEncounter",
                            "type": "AliasRef"
                          }
                        },
                        "asTypeSpecifier": {
                          "name": "{urn:hl7-org:elm-types:r1}Boolean",
                          "type": "NamedTypeSpecifier"
                        }
                      },
                      "then": {
                        "localId": "139",
                        "locator": "71:38-71:64",
                        "path": "facilityLocations",
                        "type": "Property",
                        "source": {
                          "localId": "138",
                          "locator": "71:38-71:46",
                          "name": "Encounter",
                          "type": "OperandRef"
                        }
                      },
                      "else": {
                        "localId": "145",
                        "locator": "71:71-71:140",
                        "type": "Flatten",
                        "operand": {
                          "localId": "144",
                          "locator": "71:79-71:140",
                          "type": "List",
                          "element": [
                            {
                              "localId": "141",
                              "locator": "71:81-71:109",
                              "path": "facilityLocations",
                              "scope": "EDEncounter",
                              "type": "Property"
                            },
                            {
                              "localId": "143",
                              "locator": "71:112-71:138",
                              "path": "facilityLocations",
                              "type": "Property",
                              "source": {
                                "localId": "142",
                                "locator": "71:112-71:120",
                                "name": "Encounter",
                                "type": "OperandRef"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "123",
                      "locator": "67:55-67:76",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "154",
                "locator": "74:1-75:43",
                "name": "Hospitalization Length of Stay",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "154",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospitalization Length of Stay\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "150",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "153",
                          "s": [
                            {
                              "r": "153",
                              "s": [
                                {
                                  "value": [
                                    "LengthInDays",
                                    "("
                                  ]
                                },
                                {
                                  "r": "152",
                                  "s": [
                                    {
                                      "value": [
                                        "\"Hospitalization\"",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "151",
                                      "s": [
                                        {
                                          "value": [
                                            "Encounter"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ")"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "153",
                  "locator": "75:2-75:43",
                  "name": "LengthInDays",
                  "type": "FunctionRef",
                  "operand": [
                    {
                      "localId": "152",
                      "locator": "75:15-75:42",
                      "name": "Hospitalization",
                      "type": "FunctionRef",
                      "operand": [
                        {
                          "localId": "151",
                          "locator": "75:33-75:41",
                          "name": "Encounter",
                          "type": "OperandRef"
                        }
                      ]
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "150",
                      "locator": "74:60-74:81",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "159",
                "locator": "79:1-80:38",
                "name": "Hospital Admission Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "159",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospital Admission Time\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "155",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "158",
                          "s": [
                            {
                              "r": "158",
                              "s": [
                                {
                                  "value": [
                                    "start of "
                                  ]
                                },
                                {
                                  "r": "157",
                                  "s": [
                                    {
                                      "value": [
                                        "\"Hospitalization\"",
                                        "("
                                      ]
                                    },
                                    {
                                      "r": "156",
                                      "s": [
                                        {
                                          "value": [
                                            "Encounter"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ")"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "158",
                  "locator": "80:2-80:38",
                  "type": "Start",
                  "operand": {
                    "localId": "157",
                    "locator": "80:11-80:38",
                    "name": "Hospitalization",
                    "type": "FunctionRef",
                    "operand": [
                      {
                        "localId": "156",
                        "locator": "80:29-80:37",
                        "name": "Encounter",
                        "type": "OperandRef"
                      }
                    ]
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "155",
                      "locator": "79:53-79:74",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "164",
                "locator": "83:1-84:32",
                "name": "Hospital Discharge Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "164",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospital Discharge Time\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "160",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "163",
                          "s": [
                            {
                              "r": "163",
                              "s": [
                                {
                                  "value": [
                                    "end of "
                                  ]
                                },
                                {
                                  "r": "162",
                                  "s": [
                                    {
                                      "r": "161",
                                      "s": [
                                        {
                                          "value": [
                                            "Encounter"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "."
                                      ]
                                    },
                                    {
                                      "r": "162",
                                      "s": [
                                        {
                                          "value": [
                                            "relevantPeriod"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "163",
                  "locator": "84:2-84:32",
                  "type": "End",
                  "operand": {
                    "localId": "162",
                    "locator": "84:9-84:32",
                    "path": "relevantPeriod",
                    "type": "Property",
                    "source": {
                      "localId": "161",
                      "locator": "84:9-84:17",
                      "name": "Encounter",
                      "type": "OperandRef"
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "160",
                      "locator": "83:53-83:74",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "177",
                "locator": "88:1-91:17",
                "name": "Hospital Arrival Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "177",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospital Arrival Time\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "165",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "176",
                          "s": [
                            {
                              "r": "176",
                              "s": [
                                {
                                  "value": [
                                    "start of "
                                  ]
                                },
                                {
                                  "r": "175",
                                  "s": [
                                    {
                                      "r": "174",
                                      "s": [
                                        {
                                          "value": [
                                            "First",
                                            "("
                                          ]
                                        },
                                        {
                                          "r": "173",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "r": "168",
                                                  "s": [
                                                    {
                                                      "r": "167",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "("
                                                          ]
                                                        },
                                                        {
                                                          "r": "167",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Hospitalization Locations\"",
                                                                "("
                                                              ]
                                                            },
                                                            {
                                                              "r": "166",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "Encounter"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                ")"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            ")"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "HospitalLocation"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\t\t"
                                              ]
                                            },
                                            {
                                              "r": "172",
                                              "s": [
                                                {
                                                  "value": [
                                                    "sort by "
                                                  ]
                                                },
                                                {
                                                  "r": "171",
                                                  "s": [
                                                    {
                                                      "r": "170",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "start of "
                                                          ]
                                                        },
                                                        {
                                                          "r": "169",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "locationPeriod"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t)"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "."
                                      ]
                                    },
                                    {
                                      "r": "175",
                                      "s": [
                                        {
                                          "value": [
                                            "locationPeriod"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "176",
                  "locator": "89:2-91:17",
                  "type": "Start",
                  "operand": {
                    "localId": "175",
                    "locator": "89:11-91:17",
                    "path": "locationPeriod",
                    "type": "Property",
                    "source": {
                      "localId": "174",
                      "locator": "89:11-91:2",
                      "type": "First",
                      "source": {
                        "localId": "173",
                        "locator": "89:17-90:34",
                        "type": "Query",
                        "source": [
                          {
                            "localId": "168",
                            "locator": "89:17-89:72",
                            "alias": "HospitalLocation",
                            "expression": {
                              "localId": "167",
                              "locator": "89:17-89:56",
                              "name": "Hospitalization Locations",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "166",
                                  "locator": "89:46-89:54",
                                  "name": "Encounter",
                                  "type": "OperandRef"
                                }
                              ]
                            }
                          }
                        ],
                        "relationship": [

                        ],
                        "sort": {
                          "localId": "172",
                          "locator": "90:4-90:34",
                          "by": [
                            {
                              "localId": "171",
                              "locator": "90:12-90:34",
                              "direction": "asc",
                              "type": "ByExpression",
                              "expression": {
                                "localId": "170",
                                "locator": "90:12-90:34",
                                "type": "Start",
                                "operand": {
                                  "localId": "169",
                                  "locator": "90:21-90:34",
                                  "name": "locationPeriod",
                                  "type": "IdentifierRef"
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "165",
                      "locator": "88:51-88:72",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "190",
                "locator": "94:1-97:17",
                "name": "Hospital Departure Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "190",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Hospital Departure Time\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "178",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "189",
                          "s": [
                            {
                              "r": "189",
                              "s": [
                                {
                                  "value": [
                                    "end of "
                                  ]
                                },
                                {
                                  "r": "188",
                                  "s": [
                                    {
                                      "r": "187",
                                      "s": [
                                        {
                                          "value": [
                                            "Last",
                                            "("
                                          ]
                                        },
                                        {
                                          "r": "186",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "r": "181",
                                                  "s": [
                                                    {
                                                      "r": "180",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "("
                                                          ]
                                                        },
                                                        {
                                                          "r": "180",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Hospitalization Locations\"",
                                                                "("
                                                              ]
                                                            },
                                                            {
                                                              "r": "179",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "Encounter"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                ")"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            ")"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "HospitalLocation"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\t\t"
                                              ]
                                            },
                                            {
                                              "r": "185",
                                              "s": [
                                                {
                                                  "value": [
                                                    "sort by "
                                                  ]
                                                },
                                                {
                                                  "r": "184",
                                                  "s": [
                                                    {
                                                      "r": "183",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "start of "
                                                          ]
                                                        },
                                                        {
                                                          "r": "182",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "locationPeriod"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t)"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "."
                                      ]
                                    },
                                    {
                                      "r": "188",
                                      "s": [
                                        {
                                          "value": [
                                            "locationPeriod"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "189",
                  "locator": "95:2-97:17",
                  "type": "End",
                  "operand": {
                    "localId": "188",
                    "locator": "95:9-97:17",
                    "path": "locationPeriod",
                    "type": "Property",
                    "source": {
                      "localId": "187",
                      "locator": "95:9-97:2",
                      "type": "Last",
                      "source": {
                        "localId": "186",
                        "locator": "95:14-96:34",
                        "type": "Query",
                        "source": [
                          {
                            "localId": "181",
                            "locator": "95:14-95:69",
                            "alias": "HospitalLocation",
                            "expression": {
                              "localId": "180",
                              "locator": "95:14-95:53",
                              "name": "Hospitalization Locations",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "179",
                                  "locator": "95:43-95:51",
                                  "name": "Encounter",
                                  "type": "OperandRef"
                                }
                              ]
                            }
                          }
                        ],
                        "relationship": [

                        ],
                        "sort": {
                          "localId": "185",
                          "locator": "96:4-96:34",
                          "by": [
                            {
                              "localId": "184",
                              "locator": "96:12-96:34",
                              "direction": "asc",
                              "type": "ByExpression",
                              "expression": {
                                "localId": "183",
                                "locator": "96:12-96:34",
                                "type": "Start",
                                "operand": {
                                  "localId": "182",
                                  "locator": "96:21-96:34",
                                  "name": "locationPeriod",
                                  "type": "IdentifierRef"
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "178",
                      "locator": "94:53-94:74",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "203",
                "locator": "101:1-105:17",
                "name": "Emergency Department Arrival Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "203",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Emergency Department Arrival Time\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "191",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "202",
                          "s": [
                            {
                              "r": "202",
                              "s": [
                                {
                                  "value": [
                                    "start of "
                                  ]
                                },
                                {
                                  "r": "201",
                                  "s": [
                                    {
                                      "r": "200",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "200",
                                          "s": [
                                            {
                                              "value": [
                                                "singleton from "
                                              ]
                                            },
                                            {
                                              "r": "199",
                                              "s": [
                                                {
                                                  "value": [
                                                    "( "
                                                  ]
                                                },
                                                {
                                                  "r": "199",
                                                  "s": [
                                                    {
                                                      "s": [
                                                        {
                                                          "r": "194",
                                                          "s": [
                                                            {
                                                              "r": "193",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "( "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "193",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "\"Hospitalization Locations\"",
                                                                        "("
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "192",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "Encounter"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        ")"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    ")"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                " ",
                                                                "HospitalLocation"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n\t\t\t\t"
                                                      ]
                                                    },
                                                    {
                                                      "r": "198",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "where "
                                                          ]
                                                        },
                                                        {
                                                          "r": "198",
                                                          "s": [
                                                            {
                                                              "r": "196",
                                                              "s": [
                                                                {
                                                                  "r": "195",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "HospitalLocation"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "."
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "196",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "code"
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                " in "
                                                              ]
                                                            },
                                                            {
                                                              "r": "197",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Emergency Department Visit\""
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n\t\t)"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t)"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "."
                                      ]
                                    },
                                    {
                                      "r": "201",
                                      "s": [
                                        {
                                          "value": [
                                            "locationPeriod"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "202",
                  "locator": "102:2-105:17",
                  "type": "Start",
                  "operand": {
                    "localId": "201",
                    "locator": "102:11-105:17",
                    "path": "locationPeriod",
                    "type": "Property",
                    "source": {
                      "localId": "200",
                      "locator": "102:11-105:2",
                      "type": "SingletonFrom",
                      "operand": {
                        "localId": "199",
                        "locator": "102:28-104:3",
                        "type": "Query",
                        "source": [
                          {
                            "localId": "194",
                            "locator": "102:30-102:87",
                            "alias": "HospitalLocation",
                            "expression": {
                              "localId": "193",
                              "locator": "102:30-102:70",
                              "name": "Hospitalization Locations",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "192",
                                  "locator": "102:60-102:68",
                                  "name": "Encounter",
                                  "type": "OperandRef"
                                }
                              ]
                            }
                          }
                        ],
                        "relationship": [

                        ],
                        "where": {
                          "localId": "198",
                          "locator": "103:5-103:63",
                          "type": "InValueSet",
                          "code": {
                            "localId": "196",
                            "locator": "103:11-103:31",
                            "path": "code",
                            "scope": "HospitalLocation",
                            "type": "Property"
                          },
                          "valueset": {
                            "localId": "197",
                            "locator": "103:36-103:63",
                            "name": "Emergency Department Visit"
                          }
                        }
                      }
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "191",
                      "locator": "101:63-101:84",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "224",
                "locator": "110:1-115:2",
                "name": "First Inpatient Intensive Care Unit",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "224",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"First Inpatient Intensive Care Unit\"",
                            "(",
                            "Encounter",
                            " "
                          ]
                        },
                        {
                          "r": "204",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n\t"
                          ]
                        },
                        {
                          "r": "223",
                          "s": [
                            {
                              "r": "223",
                              "s": [
                                {
                                  "value": [
                                    "First",
                                    "("
                                  ]
                                },
                                {
                                  "r": "222",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "207",
                                          "s": [
                                            {
                                              "r": "206",
                                              "s": [
                                                {
                                                  "value": [
                                                    "("
                                                  ]
                                                },
                                                {
                                                  "r": "206",
                                                  "s": [
                                                    {
                                                      "r": "205",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Encounter"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "206",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "facilityLocations"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    ")"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "HospitalLocation"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t"
                                      ]
                                    },
                                    {
                                      "r": "217",
                                      "s": [
                                        {
                                          "value": [
                                            "where "
                                          ]
                                        },
                                        {
                                          "r": "217",
                                          "s": [
                                            {
                                              "r": "211",
                                              "s": [
                                                {
                                                  "r": "209",
                                                  "s": [
                                                    {
                                                      "r": "208",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "HospitalLocation"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "209",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "code"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " in "
                                                  ]
                                                },
                                                {
                                                  "r": "210",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Intensive Care Unit\""
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\t\t\tand "
                                              ]
                                            },
                                            {
                                              "r": "216",
                                              "s": [
                                                {
                                                  "r": "213",
                                                  "s": [
                                                    {
                                                      "r": "212",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "HospitalLocation"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "213",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "locationPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " ",
                                                    "during",
                                                    " "
                                                  ]
                                                },
                                                {
                                                  "r": "215",
                                                  "s": [
                                                    {
                                                      "r": "214",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Encounter"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "215",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "relevantPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t\t"
                                      ]
                                    },
                                    {
                                      "r": "221",
                                      "s": [
                                        {
                                          "value": [
                                            "sort by "
                                          ]
                                        },
                                        {
                                          "r": "220",
                                          "s": [
                                            {
                                              "r": "219",
                                              "s": [
                                                {
                                                  "value": [
                                                    "start of "
                                                  ]
                                                },
                                                {
                                                  "r": "218",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "locationPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t)"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "223",
                  "locator": "111:2-115:2",
                  "type": "First",
                  "source": {
                    "localId": "222",
                    "locator": "111:8-114:34",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "207",
                        "locator": "111:8-111:52",
                        "alias": "HospitalLocation",
                        "expression": {
                          "localId": "206",
                          "locator": "111:8-111:36",
                          "path": "facilityLocations",
                          "type": "Property",
                          "source": {
                            "localId": "205",
                            "locator": "111:9-111:17",
                            "name": "Encounter",
                            "type": "OperandRef"
                          }
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "where": {
                      "localId": "217",
                      "locator": "112:4-113:71",
                      "type": "And",
                      "operand": [
                        {
                          "localId": "211",
                          "locator": "112:10-112:55",
                          "type": "InValueSet",
                          "code": {
                            "localId": "209",
                            "locator": "112:10-112:30",
                            "path": "code",
                            "scope": "HospitalLocation",
                            "type": "Property"
                          },
                          "valueset": {
                            "localId": "210",
                            "locator": "112:35-112:55",
                            "name": "Intensive Care Unit"
                          }
                        },
                        {
                          "localId": "216",
                          "locator": "113:9-113:71",
                          "type": "IncludedIn",
                          "operand": [
                            {
                              "localId": "213",
                              "locator": "113:9-113:39",
                              "path": "locationPeriod",
                              "scope": "HospitalLocation",
                              "type": "Property"
                            },
                            {
                              "localId": "215",
                              "locator": "113:48-113:71",
                              "path": "relevantPeriod",
                              "type": "Property",
                              "source": {
                                "localId": "214",
                                "locator": "113:48-113:56",
                                "name": "Encounter",
                                "type": "OperandRef"
                              }
                            }
                          ]
                        }
                      ]
                    },
                    "sort": {
                      "localId": "221",
                      "locator": "114:4-114:34",
                      "by": [
                        {
                          "localId": "220",
                          "locator": "114:12-114:34",
                          "direction": "asc",
                          "type": "ByExpression",
                          "expression": {
                            "localId": "219",
                            "locator": "114:12-114:34",
                            "type": "Start",
                            "operand": {
                              "localId": "218",
                              "locator": "114:21-114:34",
                              "name": "locationPeriod",
                              "type": "IdentifierRef"
                            }
                          }
                        }
                      ]
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Encounter",
                    "operandTypeSpecifier": {
                      "localId": "204",
                      "locator": "110:65-110:86",
                      "name": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              }
            ]
          }
        }
      },
      "elm_annotations": {
        "statements": [
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Encounter\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "[\"Encounter, Performed\": "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "\"Emergency Department Visit\""
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "]"
                          }
                        ]
                      }
                    ],
                    "node_type": "Retrieve",
                    "ref_id": "14"
                  }
                ],
                "ref_id": "15"
              }
            ],
            "define_name": "Encounter"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"LengthInDays\"(Value "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "Interval<"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "DateTime"
                              }
                            ]
                          }
                        ],
                        "ref_id": "20"
                      },
                      {
                        "children": [
                          {
                            "text": ">"
                          }
                        ]
                      }
                    ],
                    "ref_id": "21"
                  },
                  {
                    "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": "22"
                              }
                            ],
                            "node_type": "Start",
                            "ref_id": "23"
                          },
                          {
                            "children": [
                              {
                                "text": " and "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "end of "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Value"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "24"
                              }
                            ],
                            "node_type": "End",
                            "ref_id": "25"
                          }
                        ],
                        "node_type": "DifferenceBetween",
                        "ref_id": "26"
                      }
                    ],
                    "node_type": "DifferenceBetween",
                    "ref_id": "26"
                  }
                ],
                "ref_id": "27"
              }
            ],
            "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": "16"
                                  }
                                ],
                                "node_type": "Retrieve",
                                "ref_id": "16"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EncounterInpatient"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "17"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"LengthInDays\"("
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "EncounterInpatient"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "18"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "relevantPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "19"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "19"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ")"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "FunctionRef",
                                    "ref_id": "28"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "<= 120"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "LessOrEqual",
                                "ref_id": "30"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      and "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "EncounterInpatient"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "31"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "."
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "relevantPeriod"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "32"
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "32"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " ends during "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"Measurement Period\""
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "ParameterRef",
                                    "ref_id": "33"
                                  }
                                ],
                                "node_type": "In",
                                "ref_id": "34"
                              }
                            ],
                            "ref_id": "35"
                          }
                        ],
                        "ref_id": "35"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "36"
                  }
                ],
                "ref_id": "37"
              }
            ],
            "define_name": "Inpatient Encounter"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"ToDate\"(Value "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "38"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "DateTime("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "year from "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Value"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "39"
                              }
                            ],
                            "ref_id": "40"
                          },
                          {
                            "children": [
                              {
                                "text": ", "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "month from "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Value"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "41"
                              }
                            ],
                            "ref_id": "42"
                          },
                          {
                            "children": [
                              {
                                "text": ", "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "day from "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Value"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "43"
                              }
                            ],
                            "ref_id": "44"
                          },
                          {
                            "children": [
                              {
                                "text": ", 0, 0, 0, 0, "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "timezone from "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Value"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "49"
                              }
                            ],
                            "ref_id": "50"
                          },
                          {
                            "children": [
                              {
                                "text": ")"
                              }
                            ]
                          }
                        ],
                        "node_type": "DateTime",
                        "ref_id": "51"
                      }
                    ],
                    "node_type": "DateTime",
                    "ref_id": "51"
                  }
                ],
                "ref_id": "52"
              }
            ],
            "define_name": "ToDate"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"CalendarAgeInDaysAt\"(BirthDateTime "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "53"
                  },
                  {
                    "children": [
                      {
                        "text": ", AsOf "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "54"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "days between "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "ToDate("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "BirthDateTime"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "55"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "56"
                          },
                          {
                            "children": [
                              {
                                "text": "and "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "ToDate("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "AsOf"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "57"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "58"
                          }
                        ],
                        "node_type": "DurationBetween",
                        "ref_id": "59"
                      }
                    ],
                    "node_type": "DurationBetween",
                    "ref_id": "59"
                  }
                ],
                "ref_id": "60"
              }
            ],
            "define_name": "CalendarAgeInDaysAt"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"CalendarAgeInDays\"(BirthDateTime "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "61"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "CalendarAgeInDaysAt("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "BirthDateTime"
                                  }
                                ]
                              }
                            ],
                            "node_type": "OperandRef",
                            "ref_id": "62"
                          },
                          {
                            "children": [
                              {
                                "text": ", "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "Today()"
                                  }
                                ]
                              }
                            ],
                            "node_type": "Today",
                            "ref_id": "63"
                          },
                          {
                            "children": [
                              {
                                "text": ")"
                              }
                            ]
                          }
                        ],
                        "node_type": "FunctionRef",
                        "ref_id": "64"
                      }
                    ],
                    "node_type": "FunctionRef",
                    "ref_id": "64"
                  }
                ],
                "ref_id": "65"
              }
            ],
            "define_name": "CalendarAgeInDays"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"CalendarAgeInMonthsAt\"(BirthDateTime "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "66"
                  },
                  {
                    "children": [
                      {
                        "text": ", AsOf "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "67"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "months between "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "ToDate("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "BirthDateTime"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "68"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "69"
                          },
                          {
                            "children": [
                              {
                                "text": "and "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "ToDate("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "AsOf"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "70"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "71"
                          }
                        ],
                        "node_type": "DurationBetween",
                        "ref_id": "72"
                      }
                    ],
                    "node_type": "DurationBetween",
                    "ref_id": "72"
                  }
                ],
                "ref_id": "73"
              }
            ],
            "define_name": "CalendarAgeInMonthsAt"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"CalendarAgeInMonths\"(BirthDateTime "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "74"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "CalendarAgeInMonthsAt("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "BirthDateTime"
                                  }
                                ]
                              }
                            ],
                            "node_type": "OperandRef",
                            "ref_id": "75"
                          },
                          {
                            "children": [
                              {
                                "text": ", "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "Today()"
                                  }
                                ]
                              }
                            ],
                            "node_type": "Today",
                            "ref_id": "76"
                          },
                          {
                            "children": [
                              {
                                "text": ")"
                              }
                            ]
                          }
                        ],
                        "node_type": "FunctionRef",
                        "ref_id": "77"
                      }
                    ],
                    "node_type": "FunctionRef",
                    "ref_id": "77"
                  }
                ],
                "ref_id": "78"
              }
            ],
            "define_name": "CalendarAgeInMonths"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"CalendarAgeInYearsAt\"(BirthDateTime "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "79"
                  },
                  {
                    "children": [
                      {
                        "text": ", AsOf "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "80"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "years between "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "ToDate("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "BirthDateTime"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "81"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "82"
                          },
                          {
                            "children": [
                              {
                                "text": "and "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "ToDate("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "AsOf"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "83"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "84"
                          }
                        ],
                        "node_type": "DurationBetween",
                        "ref_id": "85"
                      }
                    ],
                    "node_type": "DurationBetween",
                    "ref_id": "85"
                  }
                ],
                "ref_id": "86"
              }
            ],
            "define_name": "CalendarAgeInYearsAt"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"CalendarAgeInYears\"(BirthDateTime "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "DateTime"
                          }
                        ]
                      }
                    ],
                    "ref_id": "87"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "CalendarAgeInYearsAt("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "BirthDateTime"
                                  }
                                ]
                              }
                            ],
                            "node_type": "OperandRef",
                            "ref_id": "88"
                          },
                          {
                            "children": [
                              {
                                "text": ", "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "Today()"
                                  }
                                ]
                              }
                            ],
                            "node_type": "Today",
                            "ref_id": "89"
                          },
                          {
                            "children": [
                              {
                                "text": ")"
                              }
                            ]
                          }
                        ],
                        "node_type": "FunctionRef",
                        "ref_id": "90"
                      }
                    ],
                    "node_type": "FunctionRef",
                    "ref_id": "90"
                  }
                ],
                "ref_id": "91"
              }
            ],
            "define_name": "CalendarAgeInYears"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospitalization\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "92"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "( "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "singleton from "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "( "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "[\"Encounter, Performed\": "
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "\"Emergency Department Visit\""
                                                                          }
                                                                        ]
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "]"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Retrieve",
                                                                "ref_id": "93"
                                                              }
                                                            ],
                                                            "node_type": "Retrieve",
                                                            "ref_id": "93"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " EDVisit"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "94"
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\n      "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "where "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "EDVisit"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "95"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "."
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "relevantPeriod"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "96"
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "96"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "ends "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "1 hour"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Quantity",
                                                                "ref_id": "100"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": " or less on or before"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "101"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "start of "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "Encounter"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "97"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "relevantPeriod"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "98"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "98"
                                                              }
                                                            ],
                                                            "node_type": "Start",
                                                            "ref_id": "99"
                                                          }
                                                        ],
                                                        "ref_id": "101"
                                                      }
                                                    ],
                                                    "ref_id": "101"
                                                  }
                                                ],
                                                "node_type": "Query",
                                                "ref_id": "102"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n  )"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Query",
                                            "ref_id": "102"
                                          }
                                        ],
                                        "node_type": "SingletonFrom",
                                        "ref_id": "103"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " )"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "SingletonFrom",
                                    "ref_id": "103"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " X"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "104"
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "text": "\n    "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "return "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "if "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "X"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "AliasRef",
                                        "ref_id": "105"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " is null"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "IsNull",
                                    "ref_id": "106"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " then "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "Encounter"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "107"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "."
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "relevantPeriod"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "108"
                                      }
                                    ],
                                    "ref_id": "108"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " else "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "Interval["
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "start of "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "X"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "109"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "relevantPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "110"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "110"
                                          }
                                        ],
                                        "ref_id": "111"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ", "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "end of "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Encounter"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "112"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "relevantPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "113"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "113"
                                          }
                                        ],
                                        "ref_id": "114"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "]"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "115"
                                  }
                                ],
                                "node_type": "If",
                                "ref_id": "116"
                              }
                            ],
                            "ref_id": "117"
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "118"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "118"
                  }
                ],
                "ref_id": "119"
              }
            ],
            "define_name": "Hospitalization"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospitalization Locations\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "123"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "( "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "singleton from "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "( "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "[\"Encounter, Performed\": "
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "\"Emergency Department Visit\""
                                                                          }
                                                                        ]
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "]"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Retrieve",
                                                                "ref_id": "124"
                                                              }
                                                            ],
                                                            "node_type": "Retrieve",
                                                            "ref_id": "124"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " EDVisit"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "125"
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\n      "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "where "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "EDVisit"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "126"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "."
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "relevantPeriod"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "127"
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "127"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "ends "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "1 hour"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Quantity",
                                                                "ref_id": "131"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": " or less on or before"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "132"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "start of "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "Encounter"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "128"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "relevantPeriod"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "129"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "129"
                                                              }
                                                            ],
                                                            "node_type": "Start",
                                                            "ref_id": "130"
                                                          }
                                                        ],
                                                        "ref_id": "132"
                                                      }
                                                    ],
                                                    "ref_id": "132"
                                                  }
                                                ],
                                                "node_type": "Query",
                                                "ref_id": "133"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n  )"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Query",
                                            "ref_id": "133"
                                          }
                                        ],
                                        "node_type": "SingletonFrom",
                                        "ref_id": "134"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " )"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "SingletonFrom",
                                    "ref_id": "134"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " EDEncounter"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "135"
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "text": "\n    "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "return "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "if "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "EDEncounter"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "AliasRef",
                                        "ref_id": "136"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " is null"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "IsNull",
                                    "ref_id": "137"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " then "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "Encounter"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "138"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "."
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "facilityLocations"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "139"
                                      }
                                    ],
                                    "ref_id": "139"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " else "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "flatten "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "{ "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "EDEncounter"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "140"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "facilityLocations"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "141"
                                              }
                                            ],
                                            "ref_id": "141"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": ", "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Encounter"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "142"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "facilityLocations"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "143"
                                              }
                                            ],
                                            "ref_id": "143"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " }"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "List",
                                        "ref_id": "144"
                                      }
                                    ],
                                    "ref_id": "145"
                                  }
                                ],
                                "node_type": "If",
                                "ref_id": "146"
                              }
                            ],
                            "ref_id": "147"
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "148"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "148"
                  }
                ],
                "ref_id": "149"
              }
            ],
            "define_name": "Hospitalization Locations"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospitalization Length of Stay\"(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": "Hospitalization Length of Stay"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospital Admission Time\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "155"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "start of "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "\"Hospitalization\"("
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Encounter"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "OperandRef",
                                "ref_id": "156"
                              },
                              {
                                "children": [
                                  {
                                    "text": ")"
                                  }
                                ]
                              }
                            ],
                            "node_type": "FunctionRef",
                            "ref_id": "157"
                          }
                        ],
                        "node_type": "Start",
                        "ref_id": "158"
                      }
                    ],
                    "node_type": "Start",
                    "ref_id": "158"
                  }
                ],
                "ref_id": "159"
              }
            ],
            "define_name": "Hospital Admission Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospital Discharge Time\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "160"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "end of "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Encounter"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "161"
                              },
                              {
                                "children": [
                                  {
                                    "text": "."
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "relevantPeriod"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "162"
                              }
                            ],
                            "node_type": "Property",
                            "ref_id": "162"
                          }
                        ],
                        "node_type": "End",
                        "ref_id": "163"
                      }
                    ],
                    "node_type": "End",
                    "ref_id": "163"
                  }
                ],
                "ref_id": "164"
              }
            ],
            "define_name": "Hospital Discharge Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospital Arrival Time\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "165"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "start of "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "First("
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "("
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Hospitalization Locations\"("
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "Encounter"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "OperandRef",
                                                        "ref_id": "166"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": ")"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "FunctionRef",
                                                    "ref_id": "167"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": ")"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "FunctionRef",
                                                "ref_id": "167"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "HospitalLocation"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "168"
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n      "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "sort by "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "start of "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "locationPeriod"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "IdentifierRef",
                                                    "ref_id": "169"
                                                  }
                                                ],
                                                "node_type": "Start",
                                                "ref_id": "170"
                                              }
                                            ],
                                            "ref_id": "171"
                                          }
                                        ],
                                        "ref_id": "172"
                                      }
                                    ],
                                    "ref_id": "173"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n  )"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "174"
                              },
                              {
                                "children": [
                                  {
                                    "text": "."
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "locationPeriod"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "175"
                              }
                            ],
                            "node_type": "Property",
                            "ref_id": "175"
                          }
                        ],
                        "node_type": "Start",
                        "ref_id": "176"
                      }
                    ],
                    "node_type": "Start",
                    "ref_id": "176"
                  }
                ],
                "ref_id": "177"
              }
            ],
            "define_name": "Hospital Arrival Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Hospital Departure Time\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "178"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "end of "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Last("
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "("
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Hospitalization Locations\"("
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "Encounter"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "OperandRef",
                                                        "ref_id": "179"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": ")"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "FunctionRef",
                                                    "ref_id": "180"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": ")"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "FunctionRef",
                                                "ref_id": "180"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "HospitalLocation"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "181"
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n      "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "sort by "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "start of "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "locationPeriod"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "IdentifierRef",
                                                    "ref_id": "182"
                                                  }
                                                ],
                                                "node_type": "Start",
                                                "ref_id": "183"
                                              }
                                            ],
                                            "ref_id": "184"
                                          }
                                        ],
                                        "ref_id": "185"
                                      }
                                    ],
                                    "ref_id": "186"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n  )"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "187"
                              },
                              {
                                "children": [
                                  {
                                    "text": "."
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "locationPeriod"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "188"
                              }
                            ],
                            "node_type": "Property",
                            "ref_id": "188"
                          }
                        ],
                        "node_type": "End",
                        "ref_id": "189"
                      }
                    ],
                    "node_type": "End",
                    "ref_id": "189"
                  }
                ],
                "ref_id": "190"
              }
            ],
            "define_name": "Hospital Departure Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Emergency Department Arrival Time\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "191"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "start of "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "singleton from "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "( "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "( "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "\"Hospitalization Locations\"("
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "Encounter"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "OperandRef",
                                                                "ref_id": "192"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": ")"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "FunctionRef",
                                                            "ref_id": "193"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": ")"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "FunctionRef",
                                                        "ref_id": "193"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " HospitalLocation"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "194"
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n        "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "where "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "HospitalLocation"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "195"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "."
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "code"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "196"
                                                          }
                                                        ],
                                                        "ref_id": "196"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " in "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Emergency Department Visit\""
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "197"
                                                      }
                                                    ],
                                                    "ref_id": "198"
                                                  }
                                                ],
                                                "ref_id": "198"
                                              }
                                            ],
                                            "node_type": "Query",
                                            "ref_id": "199"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n    )"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Query",
                                        "ref_id": "199"
                                      }
                                    ],
                                    "ref_id": "200"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n  )"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "200"
                              },
                              {
                                "children": [
                                  {
                                    "text": "."
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "locationPeriod"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "201"
                              }
                            ],
                            "node_type": "Property",
                            "ref_id": "201"
                          }
                        ],
                        "node_type": "Start",
                        "ref_id": "202"
                      }
                    ],
                    "node_type": "Start",
                    "ref_id": "202"
                  }
                ],
                "ref_id": "203"
              }
            ],
            "define_name": "Emergency Department Arrival Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"First Inpatient Intensive Care Unit\"(Encounter "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "204"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "First("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "("
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Encounter"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "205"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "facilityLocations"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "206"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "206"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": ")"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "206"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "HospitalLocation"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "207"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "where "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "HospitalLocation"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "208"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "code"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "209"
                                              }
                                            ],
                                            "ref_id": "209"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " in "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Intensive Care Unit\""
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "210"
                                          }
                                        ],
                                        "node_type": "InValueSet",
                                        "ref_id": "211"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        and "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "HospitalLocation"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "212"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "locationPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "213"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "213"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " during "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Encounter"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "214"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "relevantPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "215"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "215"
                                          }
                                        ],
                                        "node_type": "IncludedIn",
                                        "ref_id": "216"
                                      }
                                    ],
                                    "ref_id": "217"
                                  }
                                ],
                                "ref_id": "217"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "sort by "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "start of "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "locationPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "IdentifierRef",
                                            "ref_id": "218"
                                          }
                                        ],
                                        "node_type": "Start",
                                        "ref_id": "219"
                                      }
                                    ],
                                    "ref_id": "220"
                                  }
                                ],
                                "ref_id": "221"
                              }
                            ],
                            "ref_id": "222"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "First",
                        "ref_id": "223"
                      }
                    ],
                    "node_type": "First",
                    "ref_id": "223"
                  }
                ],
                "ref_id": "224"
              }
            ],
            "define_name": "First Inpatient Intensive Care Unit"
          }
        ],
        "identifier": {
          "id": "MATGlobalCommonFunctions",
          "version": "2.0.000"
        }
      },
      "is_main_library": false,
      "is_top_level": true,
      "library_name": "MATGlobalCommonFunctions",
      "library_version": "2.0.000",
      "statement_dependencies": [
        {
          "statement_name": "CalendarAgeInYearsAt",
          "statement_references": [
            {
              "hqmf_id": null,
              "library_name": "MATGlobalCommonFunctions",
              "statement_name": "ToDate"
            }
          ]
        },
        {
          "statement_name": "ToDate"
        }
      ]
    },
    {
      "cql": "library Hospice version '1.0.000'\r\n\r\nusing QDM version '5.3'\r\n\r\ncodesystem \"LOINC:2.46\": 'urn:oid:2.16.840.1.113883.6.1' version 'urn:hl7:version:2.46'\r\ncodesystem \"SNOMEDCT:2016-03\": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2016-03'\r\ncodesystem \"SNOMEDCT:2017-03\": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2017-03'\r\ncodesystem \"SNOMEDCT:2017-09\": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2017-09'\r\n\r\nvalueset \"Encounter Inpatient\": 'urn:oid:2.16.840.1.113883.3.666.5.307'\r\nvalueset \"Hospice care ambulatory\": 'urn:oid:2.16.840.1.113762.1.4.1108.15'\r\n\r\ncode \"Birthdate\": '21112-8' from \"LOINC:2.46\" display 'Birth date'\r\ncode \"Dead\": '419099009' from \"SNOMEDCT:2016-03\" display 'Dead'\r\ncode \"Discharge to healthcare facility for hospice care (procedure)\": '428371000124100' from \"SNOMEDCT:2017-09\" display 'Discharge to healthcare facility for hospice care (procedure)'\r\ncode \"Discharge to home for hospice care (procedure)\": '428361000124107' from \"SNOMEDCT:2017-09\" display 'Discharge to home for hospice care (procedure)'\r\n\r\nparameter \"Measurement Period\" Interval<DateTime>\r\n\r\ncontext Patient\r\n\r\ndefine \"Has Hospice\":\r\n\texists ( [\"Encounter, Performed\": \"Encounter Inpatient\"] DischargeHospice\r\n\t\t\twhere ( DischargeHospice.dischargeDisposition as Code ~ \"Discharge to home for hospice care (procedure)\"\r\n\t\t\t\t\tor DischargeHospice.dischargeDisposition as Code ~ \"Discharge to healthcare facility for hospice care (procedure)\"\r\n\t\t\t)\r\n\t\t\t\tand DischargeHospice.relevantPeriod ends during \"Measurement Period\"\r\n\t)\r\n\t\tor exists ( [\"Intervention, Order\": \"Hospice care ambulatory\"] HospiceOrder\r\n\t\t\t\twhere HospiceOrder.authorDatetime during \"Measurement Period\"\r\n\t\t)\r\n\t\tor exists ( [\"Intervention, Performed\": \"Hospice care ambulatory\"] HospicePerformed\r\n\t\t\t\twhere HospicePerformed.relevantPeriod overlaps \"Measurement Period\"\r\n\t\t)\r\n",
      "elm": {
        "library": {
          "identifier": {
            "id": "Hospice",
            "version": "1.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_3",
                "version": "5.3"
              }
            ]
          },
          "parameters": {
            "def": [
              {
                "localId": "18",
                "locator": "18:1-18:49",
                "name": "Measurement Period",
                "accessLevel": "Public",
                "parameterTypeSpecifier": {
                  "localId": "17",
                  "locator": "18:32-18:49",
                  "type": "IntervalTypeSpecifier",
                  "pointType": {
                    "localId": "16",
                    "locator": "18:41-18:48",
                    "name": "{urn:hl7-org:elm-types:r1}DateTime",
                    "type": "NamedTypeSpecifier"
                  }
                }
              }
            ]
          },
          "codeSystems": {
            "def": [
              {
                "localId": "2",
                "locator": "5:1-5:87",
                "name": "LOINC:2.46",
                "id": "2.16.840.1.113883.6.1",
                "version": "urn:hl7:version:2.46",
                "accessLevel": "Public"
              },
              {
                "localId": "3",
                "locator": "6:1-6:97",
                "name": "SNOMEDCT:2016-03",
                "id": "2.16.840.1.113883.6.96",
                "version": "urn:hl7:version:2016-03",
                "accessLevel": "Public"
              },
              {
                "localId": "4",
                "locator": "7:1-7:97",
                "name": "SNOMEDCT:2017-03",
                "id": "2.16.840.1.113883.6.96",
                "version": "urn:hl7:version:2017-03",
                "accessLevel": "Public"
              },
              {
                "localId": "5",
                "locator": "8:1-8:97",
                "name": "SNOMEDCT:2017-09",
                "id": "2.16.840.1.113883.6.96",
                "version": "urn:hl7:version:2017-09",
                "accessLevel": "Public"
              }
            ]
          },
          "valueSets": {
            "def": [
              {
                "localId": "6",
                "locator": "10:1-10:71",
                "name": "Encounter Inpatient",
                "id": "2.16.840.1.113883.3.666.5.307",
                "accessLevel": "Public"
              },
              {
                "localId": "7",
                "locator": "11:1-11:75",
                "name": "Hospice care ambulatory",
                "id": "2.16.840.1.113762.1.4.1108.15",
                "accessLevel": "Public"
              }
            ]
          },
          "codes": {
            "def": [
              {
                "localId": "9",
                "locator": "13:1-13:66",
                "name": "Birthdate",
                "id": "21112-8",
                "display": "Birth date",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "8",
                  "locator": "13:34-13:45",
                  "name": "LOINC:2.46"
                }
              },
              {
                "localId": "11",
                "locator": "14:1-14:63",
                "name": "Dead",
                "id": "419099009",
                "display": "Dead",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "10",
                  "locator": "14:31-14:48",
                  "name": "SNOMEDCT:2016-03"
                }
              },
              {
                "localId": "13",
                "locator": "15:1-15:183",
                "name": "Discharge to healthcare facility for hospice care (procedure)",
                "id": "428371000124100",
                "display": "Discharge to healthcare facility for hospice care (procedure)",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "12",
                  "locator": "15:94-15:111",
                  "name": "SNOMEDCT:2017-09"
                }
              },
              {
                "localId": "15",
                "locator": "16:1-16:153",
                "name": "Discharge to home for hospice care (procedure)",
                "id": "428361000124107",
                "display": "Discharge to home for hospice care (procedure)",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "14",
                  "locator": "16:79-16:96",
                  "name": "SNOMEDCT:2017-09"
                }
              }
            ]
          },
          "statements": {
            "def": [
              {
                "locator": "20:1-20:15",
                "name": "Patient",
                "context": "Patient",
                "expression": {
                  "type": "SingletonFrom",
                  "operand": {
                    "locator": "20:1-20:15",
                    "dataType": "{urn:healthit-gov:qdm:v5_3}Patient",
                    "templateId": "Patient",
                    "type": "Retrieve"
                  }
                }
              },
              {
                "localId": "59",
                "locator": "22:1-34:3",
                "name": "Has Hospice",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "59",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Has Hospice\"",
                            ":\n\t"
                          ]
                        },
                        {
                          "r": "58",
                          "s": [
                            {
                              "r": "49",
                              "s": [
                                {
                                  "r": "40",
                                  "s": [
                                    {
                                      "value": [
                                        "exists "
                                      ]
                                    },
                                    {
                                      "r": "39",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "39",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "r": "20",
                                                  "s": [
                                                    {
                                                      "r": "19",
                                                      "s": [
                                                        {
                                                          "r": "19",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "[",
                                                                "\"Encounter, Performed\"",
                                                                ": "
                                                              ]
                                                            },
                                                            {
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Encounter Inpatient\""
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "]"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        " ",
                                                        "DischargeHospice"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\t\t"
                                              ]
                                            },
                                            {
                                              "r": "38",
                                              "s": [
                                                {
                                                  "value": [
                                                    "where "
                                                  ]
                                                },
                                                {
                                                  "r": "38",
                                                  "s": [
                                                    {
                                                      "r": "33",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "( "
                                                          ]
                                                        },
                                                        {
                                                          "r": "33",
                                                          "s": [
                                                            {
                                                              "r": "26",
                                                              "s": [
                                                                {
                                                                  "r": "24",
                                                                  "s": [
                                                                    {
                                                                      "r": "22",
                                                                      "s": [
                                                                        {
                                                                          "r": "21",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "DischargeHospice"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "22",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "dischargeDisposition"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        " as "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "23",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "Code"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " ",
                                                                    "~",
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "25",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "\"Discharge to home for hospice care (procedure)\""
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "\n\t\t\t\t\tor "
                                                              ]
                                                            },
                                                            {
                                                              "r": "32",
                                                              "s": [
                                                                {
                                                                  "r": "30",
                                                                  "s": [
                                                                    {
                                                                      "r": "28",
                                                                      "s": [
                                                                        {
                                                                          "r": "27",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "DischargeHospice"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "28",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "dischargeDisposition"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        " as "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "29",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "Code"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " ",
                                                                    "~",
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "31",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "\"Discharge to healthcare facility for hospice care (procedure)\""
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "\n\t\t\t)"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n\t\t\t\tand "
                                                      ]
                                                    },
                                                    {
                                                      "r": "37",
                                                      "s": [
                                                        {
                                                          "r": "35",
                                                          "s": [
                                                            {
                                                              "r": "34",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "DischargeHospice"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "35",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "relevantPeriod"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            " ",
                                                            "ends during",
                                                            " "
                                                          ]
                                                        },
                                                        {
                                                          "r": "36",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Measurement Period\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t)"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n\t\tor "
                                  ]
                                },
                                {
                                  "r": "48",
                                  "s": [
                                    {
                                      "value": [
                                        "exists "
                                      ]
                                    },
                                    {
                                      "r": "47",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "47",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "r": "42",
                                                  "s": [
                                                    {
                                                      "r": "41",
                                                      "s": [
                                                        {
                                                          "r": "41",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "[",
                                                                "\"Intervention, Order\"",
                                                                ": "
                                                              ]
                                                            },
                                                            {
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Hospice care ambulatory\""
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "]"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        " ",
                                                        "HospiceOrder"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n\t\t\t\t"
                                              ]
                                            },
                                            {
                                              "r": "46",
                                              "s": [
                                                {
                                                  "value": [
                                                    "where "
                                                  ]
                                                },
                                                {
                                                  "r": "46",
                                                  "s": [
                                                    {
                                                      "r": "44",
                                                      "s": [
                                                        {
                                                          "r": "43",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "HospiceOrder"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "."
                                                          ]
                                                        },
                                                        {
                                                          "r": "44",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "authorDatetime"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        " ",
                                                        "during",
                                                        " "
                                                      ]
                                                    },
                                                    {
                                                      "r": "45",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Measurement Period\""
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t\t)"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n\t\tor "
                              ]
                            },
                            {
                              "r": "57",
                              "s": [
                                {
                                  "value": [
                                    "exists "
                                  ]
                                },
                                {
                                  "r": "56",
                                  "s": [
                                    {
                                      "value": [
                                        "( "
                                      ]
                                    },
                                    {
                                      "r": "56",
                                      "s": [
                                        {
                                          "s": [
                                            {
                                              "r": "51",
                                              "s": [
                                                {
                                                  "r": "50",
                                                  "s": [
                                                    {
                                                      "r": "50",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "[",
                                                            "\"Intervention, Performed\"",
                                                            ": "
                                                          ]
                                                        },
                                                        {
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Hospice care ambulatory\""
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "]"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " ",
                                                    "HospicePerformed"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n\t\t\t\t"
                                          ]
                                        },
                                        {
                                          "r": "55",
                                          "s": [
                                            {
                                              "value": [
                                                "where "
                                              ]
                                            },
                                            {
                                              "r": "55",
                                              "s": [
                                                {
                                                  "r": "53",
                                                  "s": [
                                                    {
                                                      "r": "52",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "HospicePerformed"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "53",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "relevantPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " ",
                                                    "overlaps",
                                                    " "
                                                  ]
                                                },
                                                {
                                                  "r": "54",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Measurement Period\""
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n\t\t)"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "58",
                  "locator": "23:2-34:3",
                  "type": "Or",
                  "operand": [
                    {
                      "localId": "49",
                      "locator": "23:2-31:3",
                      "type": "Or",
                      "operand": [
                        {
                          "localId": "40",
                          "locator": "23:2-28:2",
                          "type": "Exists",
                          "operand": {
                            "localId": "39",
                            "locator": "23:9-28:2",
                            "type": "Query",
                            "source": [
                              {
                                "localId": "20",
                                "locator": "23:11-23:74",
                                "alias": "DischargeHospice",
                                "expression": {
                                  "localId": "19",
                                  "locator": "23:11-23:57",
                                  "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveEncounterPerformed",
                                  "templateId": "PositiveEncounterPerformed",
                                  "codeProperty": "code",
                                  "type": "Retrieve",
                                  "codes": {
                                    "name": "Encounter Inpatient",
                                    "type": "ValueSetRef"
                                  }
                                }
                              }
                            ],
                            "relationship": [

                            ],
                            "where": {
                              "localId": "38",
                              "locator": "24:4-27:72",
                              "type": "And",
                              "operand": [
                                {
                                  "localId": "33",
                                  "locator": "24:10-26:4",
                                  "type": "Or",
                                  "operand": [
                                    {
                                      "localId": "26",
                                      "locator": "24:12-24:107",
                                      "type": "Equivalent",
                                      "operand": [
                                        {
                                          "localId": "24",
                                          "locator": "24:12-24:56",
                                          "strict": false,
                                          "type": "As",
                                          "operand": {
                                            "localId": "22",
                                            "locator": "24:12-24:48",
                                            "path": "dischargeDisposition",
                                            "scope": "DischargeHospice",
                                            "type": "Property"
                                          },
                                          "asTypeSpecifier": {
                                            "localId": "23",
                                            "locator": "24:53-24:56",
                                            "name": "{urn:hl7-org:elm-types:r1}Code",
                                            "type": "NamedTypeSpecifier"
                                          }
                                        },
                                        {
                                          "localId": "25",
                                          "locator": "24:60-24:107",
                                          "name": "Discharge to home for hospice care (procedure)",
                                          "type": "CodeRef"
                                        }
                                      ]
                                    },
                                    {
                                      "localId": "32",
                                      "locator": "25:9-25:119",
                                      "type": "Equivalent",
                                      "operand": [
                                        {
                                          "localId": "30",
                                          "locator": "25:9-25:53",
                                          "strict": false,
                                          "type": "As",
                                          "operand": {
                                            "localId": "28",
                                            "locator": "25:9-25:45",
                                            "path": "dischargeDisposition",
                                            "scope": "DischargeHospice",
                                            "type": "Property"
                                          },
                                          "asTypeSpecifier": {
                                            "localId": "29",
                                            "locator": "25:50-25:53",
                                            "name": "{urn:hl7-org:elm-types:r1}Code",
                                            "type": "NamedTypeSpecifier"
                                          }
                                        },
                                        {
                                          "localId": "31",
                                          "locator": "25:57-25:119",
                                          "name": "Discharge to healthcare facility for hospice care (procedure)",
                                          "type": "CodeRef"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "localId": "37",
                                  "locator": "27:9-27:72",
                                  "type": "In",
                                  "operand": [
                                    {
                                      "locator": "27:41-27:44",
                                      "type": "End",
                                      "operand": {
                                        "localId": "35",
                                        "locator": "27:9-27:39",
                                        "path": "relevantPeriod",
                                        "scope": "DischargeHospice",
                                        "type": "Property"
                                      }
                                    },
                                    {
                                      "localId": "36",
                                      "locator": "27:53-27:72",
                                      "name": "Measurement Period",
                                      "type": "ParameterRef"
                                    }
                                  ]
                                }
                              ]
                            }
                          }
                        },
                        {
                          "localId": "48",
                          "locator": "29:6-31:3",
                          "type": "Exists",
                          "operand": {
                            "localId": "47",
                            "locator": "29:13-31:3",
                            "type": "Query",
                            "source": [
                              {
                                "localId": "42",
                                "locator": "29:15-29:77",
                                "alias": "HospiceOrder",
                                "expression": {
                                  "localId": "41",
                                  "locator": "29:15-29:64",
                                  "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveInterventionOrder",
                                  "templateId": "PositiveInterventionOrder",
                                  "codeProperty": "code",
                                  "type": "Retrieve",
                                  "codes": {
                                    "name": "Hospice care ambulatory",
                                    "type": "ValueSetRef"
                                  }
                                }
                              }
                            ],
                            "relationship": [

                            ],
                            "where": {
                              "localId": "46",
                              "locator": "30:5-30:65",
                              "type": "In",
                              "operand": [
                                {
                                  "localId": "44",
                                  "locator": "30:11-30:37",
                                  "path": "authorDatetime",
                                  "scope": "HospiceOrder",
                                  "type": "Property"
                                },
                                {
                                  "localId": "45",
                                  "locator": "30:46-30:65",
                                  "name": "Measurement Period",
                                  "type": "ParameterRef"
                                }
                              ]
                            }
                          }
                        }
                      ]
                    },
                    {
                      "localId": "57",
                      "locator": "32:6-34:3",
                      "type": "Exists",
                      "operand": {
                        "localId": "56",
                        "locator": "32:13-34:3",
                        "type": "Query",
                        "source": [
                          {
                            "localId": "51",
                            "locator": "32:15-32:85",
                            "alias": "HospicePerformed",
                            "expression": {
                              "localId": "50",
                              "locator": "32:15-32:68",
                              "dataType": "{urn:healthit-gov:qdm:v5_3}PositiveInterventionPerformed",
                              "templateId": "PositiveInterventionPerformed",
                              "codeProperty": "code",
                              "type": "Retrieve",
                              "codes": {
                                "name": "Hospice care ambulatory",
                                "type": "ValueSetRef"
                              }
                            }
                          }
                        ],
                        "relationship": [

                        ],
                        "where": {
                          "localId": "55",
                          "locator": "33:5-33:71",
                          "type": "Overlaps",
                          "operand": [
                            {
                              "localId": "53",
                              "locator": "33:11-33:41",
                              "path": "relevantPeriod",
                              "scope": "HospicePerformed",
                              "type": "Property"
                            },
                            {
                              "localId": "54",
                              "locator": "33:52-33:71",
                              "name": "Measurement Period",
                              "type": "ParameterRef"
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      },
      "elm_annotations": {
        "statements": [
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Has Hospice\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "exists "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "[\"Encounter, Performed\": "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Encounter Inpatient\""
                                                              }
                                                            ]
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "]"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "Retrieve",
                                                    "ref_id": "19"
                                                  }
                                                ],
                                                "node_type": "Retrieve",
                                                "ref_id": "19"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " DischargeHospice"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "20"
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n      "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "where "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "( "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "DischargeHospice"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "21"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "dischargeDisposition"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "22"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "22"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": " as "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "Code"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "23"
                                                              }
                                                            ],
                                                            "node_type": "As",
                                                            "ref_id": "24"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " ~ "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "\"Discharge to home for hospice care (procedure)\""
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "CodeRef",
                                                            "ref_id": "25"
                                                          }
                                                        ],
                                                        "node_type": "Equivalent",
                                                        "ref_id": "26"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\n          or "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "DischargeHospice"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "27"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "dischargeDisposition"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "28"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "28"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": " as "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "Code"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "29"
                                                              }
                                                            ],
                                                            "node_type": "As",
                                                            "ref_id": "30"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " ~ "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "\"Discharge to healthcare facility for hospice care (procedure)\""
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "CodeRef",
                                                            "ref_id": "31"
                                                          }
                                                        ],
                                                        "node_type": "Equivalent",
                                                        "ref_id": "32"
                                                      }
                                                    ],
                                                    "node_type": "Or",
                                                    "ref_id": "33"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\n      )"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Or",
                                                "ref_id": "33"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n        and "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "DischargeHospice"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "34"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "relevantPeriod"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "35"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "35"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " ends during "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Measurement Period\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "ParameterRef",
                                                    "ref_id": "36"
                                                  }
                                                ],
                                                "node_type": "In",
                                                "ref_id": "37"
                                              }
                                            ],
                                            "ref_id": "38"
                                          }
                                        ],
                                        "ref_id": "38"
                                      }
                                    ],
                                    "node_type": "Query",
                                    "ref_id": "39"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n  )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Query",
                                "ref_id": "39"
                              }
                            ],
                            "node_type": "Exists",
                            "ref_id": "40"
                          },
                          {
                            "children": [
                              {
                                "text": "\n    or "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "exists "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "[\"Intervention, Order\": "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Hospice care ambulatory\""
                                                              }
                                                            ]
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "]"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "Retrieve",
                                                    "ref_id": "41"
                                                  }
                                                ],
                                                "node_type": "Retrieve",
                                                "ref_id": "41"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " HospiceOrder"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "42"
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "where "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "HospiceOrder"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "43"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "."
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "authorDatetime"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "44"
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "44"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " during "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Measurement Period\""
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "ParameterRef",
                                                "ref_id": "45"
                                              }
                                            ],
                                            "ref_id": "46"
                                          }
                                        ],
                                        "ref_id": "46"
                                      }
                                    ],
                                    "node_type": "Query",
                                    "ref_id": "47"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n    )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Query",
                                "ref_id": "47"
                              }
                            ],
                            "node_type": "Exists",
                            "ref_id": "48"
                          }
                        ],
                        "node_type": "Or",
                        "ref_id": "49"
                      },
                      {
                        "children": [
                          {
                            "text": "\n    or "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "exists "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "( "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "[\"Intervention, Performed\": "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Hospice care ambulatory\""
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "]"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Retrieve",
                                                "ref_id": "50"
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "50"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " HospicePerformed"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "51"
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n        "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "where "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "HospicePerformed"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "52"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "relevantPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "53"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "53"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " overlaps "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Measurement Period\""
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "ParameterRef",
                                            "ref_id": "54"
                                          }
                                        ],
                                        "ref_id": "55"
                                      }
                                    ],
                                    "ref_id": "55"
                                  }
                                ],
                                "node_type": "Query",
                                "ref_id": "56"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n    )"
                                  }
                                ]
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "56"
                          }
                        ],
                        "node_type": "Exists",
                        "ref_id": "57"
                      }
                    ],
                    "node_type": "Or",
                    "ref_id": "58"
                  }
                ],
                "ref_id": "59"
              }
            ],
            "define_name": "Has Hospice"
          }
        ],
        "identifier": {
          "id": "Hospice",
          "version": "1.0.000"
        }
      },
      "is_main_library": false,
      "is_top_level": true,
      "library_name": "Hospice",
      "library_version": "1.0.000",
      "statement_dependencies": [
        {
          "statement_name": "Has Hospice"
        }
      ]
    }
  ],
  "created_at": null,
  "description": "Percentage of patients 13 years of age and older with a new episode of alcohol or other drug abuse or (AOD) dependence who received the following. Two rates are reported.\na. Percentage of patients who initiated treatment within 14 days of the diagnosis.\nb. Percentage of patients who initiated treatment and who had two or more additional services with an AOD diagnosis within 30 days of the initiation visit.",
  "hqmf_id": "40280382-6258-7581-0162-92A37A9B15DF",
  "hqmf_set_id": "C3657D72-21B4-4675-820A-86C7FE293BF5",
  "hqmf_version_number": "7",
  "main_cql_library": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
  "measure_attributes": [
    {
      "code": "OTH",
      "value": "137",
      "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": "137",
        "media_type": "text/plain"
      }
    },
    {
      "code": "OTH",
      "value": "0004",
      "name": "NQF Number",
      "code_obj": {
        "type": "CD",
        "null_flavor": "OTH",
        "original_text": "NQF Number"
      },
      "value_obj": {
        "type": "ED",
        "value": "0004",
        "media_type": "text/plain"
      }
    },
    {
      "code": "COPY",
      "value": "This Physician Performance Measure (Measure) and related data specifications were developed by the National Committee for Quality Assurance (NCQA). NCQA is not responsible for any use of the Measure. NCQA makes no representations, warranties, or endorsement about the quality of any organization or physician that uses or reports performance measures and NCQA has no liability to anyone who relies on such measures or specifications. NCQA holds a copyright in the Measure. The Measure can be reproduced and distributed, without modification, for noncommercial purposes (eg, use by healthcare providers in connection with their practices) without obtaining approval from NCQA. Commercial use is defined as the sale, licensing, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain. All commercial uses or requests for modification must be approved by NCQA and are subject to a license at the discretion of NCQA. (C) 2012-2017 National Committee for Quality Assurance. All Rights Reserved. \n\nLimited 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. NCQA disclaims all liability for use or accuracy of any third party codes contained in the specifications.\n\nCPT(R) contained in the Measure specifications is copyright 2004-2017 American Medical Association. LOINC(R) copyright 2004-2017 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R] ) copyright 2004-2017 International Health Terminology Standards Development Organisation. ICD-10 copyright 2017 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": "This Physician Performance Measure (Measure) and related data specifications were developed by the National Committee for Quality Assurance (NCQA). NCQA is not responsible for any use of the Measure. NCQA makes no representations, warranties, or endorsement about the quality of any organization or physician that uses or reports performance measures and NCQA has no liability to anyone who relies on such measures or specifications. NCQA holds a copyright in the Measure. The Measure can be reproduced and distributed, without modification, for noncommercial purposes (eg, use by healthcare providers in connection with their practices) without obtaining approval from NCQA. Commercial use is defined as the sale, licensing, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain. All commercial uses or requests for modification must be approved by NCQA and are subject to a license at the discretion of NCQA. (C) 2012-2017 National Committee for Quality Assurance. All Rights Reserved. \n\nLimited 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. NCQA disclaims all liability for use or accuracy of any third party codes contained in the specifications.\n\nCPT(R) contained in the Measure specifications is copyright 2004-2017 American Medical Association. LOINC(R) copyright 2004-2017 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R] ) copyright 2004-2017 International Health Terminology Standards Development Organisation. ICD-10 copyright 2017 World Health Organization. All Rights Reserved.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "DISC",
      "value": "The performance Measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE 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": "The performance Measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE 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.1.11.20367",
        "code": "PROPOR",
        "title": "Proportion"
      }
    },
    {
      "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.1.11.20368",
        "code": "PROCESS",
        "title": "PROCESS"
      }
    },
    {
      "code": "STRAT",
      "value": "Report a total score, and each of the following strata:\nStratum 1: Patients age 13-17 \nStratum 2: Patients age >=18",
      "name": "Stratification",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "STRAT",
        "title": "Stratification"
      },
      "value_obj": {
        "type": "ED",
        "value": "Report a total score, and each of the following strata:\nStratum 1: Patients age 13-17 \nStratum 2: Patients age >=18",
        "media_type": "text/plain"
      }
    },
    {
      "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": "There are more deaths, illnesses and disabilities from substance abuse than from any other preventable health condition.  Treatment of medical problems caused by substance use and abuse places a huge burden on the health care system (Schneider Institute 2001). According to a report from the 2001 National Household Survey on Drug Abuse (NHSDA), an estimated 16.6 million Americans aged 12 or older in 2001 were classified with dependence on or abuse of either alcohol or illicit drugs (7.3 percent of the total population) (Substance Abuse and Mental Health Services Administration 2008). Of these, 2.4 million were classified with dependence on or abuse of both alcohol and illicit drugs, 3.2 million were dependent on or abused illicit drugs but not alcohol, and 11.0 million were dependent on or abused alcohol but not illicit drugs (Substance Abuse and Mental Health Services Administration 2008).",
      "name": "Rationale",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "RAT",
        "title": "Rationale"
      },
      "value_obj": {
        "type": "ED",
        "value": "There are more deaths, illnesses and disabilities from substance abuse than from any other preventable health condition.  Treatment of medical problems caused by substance use and abuse places a huge burden on the health care system (Schneider Institute 2001). According to a report from the 2001 National Household Survey on Drug Abuse (NHSDA), an estimated 16.6 million Americans aged 12 or older in 2001 were classified with dependence on or abuse of either alcohol or illicit drugs (7.3 percent of the total population) (Substance Abuse and Mental Health Services Administration 2008). Of these, 2.4 million were classified with dependence on or abuse of both alcohol and illicit drugs, 3.2 million were dependent on or abused illicit drugs but not alcohol, and 11.0 million were dependent on or abused alcohol but not illicit drugs (Substance Abuse and Mental Health Services Administration 2008).",
        "media_type": "text/plain"
      }
    },
    {
      "code": "CRS",
      "value": "American Psychiatric Association (2006)\n* Because many substance use disorders are chronic, patients usually require long-term treatment, although the intensity and specific components of treatment may vary over time [I rating]. \n* It is important to intensify the monitoring for substance use during periods when the patient is at a high risk of relapsing, including during the early stages of treatment, times of transition to less intensive levels of care, and the first year after active treatment has ceased [I rating].\n* Outpatient treatment of substance use disorders is appropriate for patients whose clinical condition or environmental circumstances do not require a more intensive level of care [I rating]. As in other treatment settings, a comprehensive approach is optimal, using, where indicated, a variety of psychotherapeutic and pharmacological interventions along with behavioral monitoring [I rating ].\n* Naltrexone, injectable naltrexone, acamprosate, a y-aminobutyric acid (GABA) are recommended for patients with alcohol dependence [I rating]. Disulfiram is also recommended for patients with alcohol dependence [II rating]. \n* Methadone and buprenorphine are recommended for patients with opioid dependence [I rating]. Naltrexone is an alternative strategy [I rating].\n\nMichigan Quality Improvement Consortium (2013)\n* Patient Education and Brief Intervention by Primary Care Physician (PCP) or Trained Staff (eg, RN, MSW) [A rating]\n* Assess patient's risk, understanding, and readiness to change. \n* Discuss the relationship of substance use to presenting medical concerns or psychosocial problems. \n* Negotiate goals and strategies for reducing consumption and other change. \n* Involve family members as appropriate. \n\nReferral\n* Refer to a substance abuse health specialist, an addiction physician specialist, or a physician experienced in pharmacologic management of addiction [D rating] \n* Initiate treatment within 14 days \n* Frequent follow-up is helpful to support behavior change; preferably 2 visits within 30 days \n* Also consider referrals to community-based services (eg, Alcoholics Anonymous [AA], Narcotics Anonymous [NA], etc.), or an Employee Assistance Program",
      "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": "American Psychiatric Association (2006)\n* Because many substance use disorders are chronic, patients usually require long-term treatment, although the intensity and specific components of treatment may vary over time [I rating]. \n* It is important to intensify the monitoring for substance use during periods when the patient is at a high risk of relapsing, including during the early stages of treatment, times of transition to less intensive levels of care, and the first year after active treatment has ceased [I rating].\n* Outpatient treatment of substance use disorders is appropriate for patients whose clinical condition or environmental circumstances do not require a more intensive level of care [I rating]. As in other treatment settings, a comprehensive approach is optimal, using, where indicated, a variety of psychotherapeutic and pharmacological interventions along with behavioral monitoring [I rating ].\n* Naltrexone, injectable naltrexone, acamprosate, a y-aminobutyric acid (GABA) are recommended for patients with alcohol dependence [I rating]. Disulfiram is also recommended for patients with alcohol dependence [II rating]. \n* Methadone and buprenorphine are recommended for patients with opioid dependence [I rating]. Naltrexone is an alternative strategy [I rating].\n\nMichigan Quality Improvement Consortium (2013)\n* Patient Education and Brief Intervention by Primary Care Physician (PCP) or Trained Staff (eg, RN, MSW) [A rating]\n* Assess patient's risk, understanding, and readiness to change. \n* Discuss the relationship of substance use to presenting medical concerns or psychosocial problems. \n* Negotiate goals and strategies for reducing consumption and other change. \n* Involve family members as appropriate. \n\nReferral\n* Refer to a substance abuse health specialist, an addiction physician specialist, or a physician experienced in pharmacologic management of addiction [D rating] \n* Initiate treatment within 14 days \n* Frequent follow-up is helpful to support behavior change; preferably 2 visits within 30 days \n* Also consider referrals to community-based services (eg, Alcoholics Anonymous [AA], Narcotics Anonymous [NA], etc.), or an Employee Assistance Program",
        "media_type": "text/plain"
      }
    },
    {
      "code": "IDUR",
      "value": "Higher score indicates better 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": "Higher score indicates better quality",
        "media_type": "text/plain"
      }
    },
    {
      "code": "REF",
      "value": "Schneider Institute for Health Policy, Brandeis University. 2001. Substance Abuse: The Nation's Number One Health Problem. Princeton: Robert Wood Johnson Foundation.",
      "name": "Reference",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "REF",
        "title": "Reference"
      },
      "value_obj": {
        "type": "ED",
        "value": "Schneider Institute for Health Policy, Brandeis University. 2001. Substance Abuse: The Nation's Number One Health Problem. Princeton: Robert Wood Johnson Foundation.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "REF",
      "value": "Substance Abuse and Mental Health Services Administration, Office of Applied Studies. 2008. Results from the 2007 National Survey on Drug Use and Health: National Finding. NSDUH Series H-34, DHHS Publication No. SMA 08-4343. Rockville, MD.",
      "name": "Reference",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "REF",
        "title": "Reference"
      },
      "value_obj": {
        "type": "ED",
        "value": "Substance Abuse and Mental Health Services Administration, Office of Applied Studies. 2008. Results from the 2007 National Survey on Drug Use and Health: National Finding. NSDUH Series H-34, DHHS Publication No. SMA 08-4343. Rockville, MD.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "REF",
      "value": "Work Group on Substance Use Disorders, Kleber H.D., R.D. Weiss, R.F. Anton, B.J. Rounsaville, T.P. George, E.C. Strain, S.F. Greenfield, D.M. Ziedonis, T.R. Kosten, G. Hennessy, C.P. O'Brien, H.S. Connery HS, American Psychiatric Association Steering Committee on Practice Guidelines, McIntyre J.S., S.C. Charles, D.J. Anzia, J.E. Nininger, I.A. Cook, P. Summergrad, M.T. Finnerty, S.M. Woods, B.R. Johnson, J. Yager, R. Pyles, L. Lurie, C.D. Cross, R.D. Walker, R. Peele, M.A. Barnovitz, S.H. Gray, J.P. Shemo, S. Saxena, T. Tonnu, R. Kunkle, A.B. Albert, L.J. Fochtmann, C. Hart, D. Regier. 2006. Treatment of patients with substance use disorders, second edition. American Psychiatric Association. Am J Psychiatry 163(8 Suppl):5-82.",
      "name": "Reference",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "REF",
        "title": "Reference"
      },
      "value_obj": {
        "type": "ED",
        "value": "Work Group on Substance Use Disorders, Kleber H.D., R.D. Weiss, R.F. Anton, B.J. Rounsaville, T.P. George, E.C. Strain, S.F. Greenfield, D.M. Ziedonis, T.R. Kosten, G. Hennessy, C.P. O'Brien, H.S. Connery HS, American Psychiatric Association Steering Committee on Practice Guidelines, McIntyre J.S., S.C. Charles, D.J. Anzia, J.E. Nininger, I.A. Cook, P. Summergrad, M.T. Finnerty, S.M. Woods, B.R. Johnson, J. Yager, R. Pyles, L. Lurie, C.D. Cross, R.D. Walker, R. Peele, M.A. Barnovitz, S.H. Gray, J.P. Shemo, S. Saxena, T. Tonnu, R. Kunkle, A.B. Albert, L.J. Fochtmann, C. Hart, D. Regier. 2006. Treatment of patients with substance use disorders, second edition. American Psychiatric Association. Am J Psychiatry 163(8 Suppl):5-82.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "REF",
      "value": "Michigan Quality Improvement Consortium. 2013. Screening, diagnosis and referral for substance use disorders. Southfield (MI): Michigan Quality Improvement Consortium.",
      "name": "Reference",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "REF",
        "title": "Reference"
      },
      "value_obj": {
        "type": "ED",
        "value": "Michigan Quality Improvement Consortium. 2013. Screening, diagnosis and referral for substance use disorders. Southfield (MI): Michigan Quality Improvement Consortium.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "DEF",
      "value": "The initiation visit is the first visit for alcohol or other drug dependence treatment within 14 days after a diagnosis of alcohol or other drug dependence.\n\nTreatment includes inpatient AOD admissions, outpatient visits, intensive outpatient encounters or partial hospitalization.\n\nThe Intake Period: January 1-November 15 of the measurement year. The Intake Period is used to capture new episodes of Alcohol or Drug Dependence. The November 15 cut-off date ensures that all services can occur before the measurement period ends.",
      "name": "Definition",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "DEF",
        "title": "Definition"
      },
      "value_obj": {
        "type": "ED",
        "value": "The initiation visit is the first visit for alcohol or other drug dependence treatment within 14 days after a diagnosis of alcohol or other drug dependence.\n\nTreatment includes inpatient AOD admissions, outpatient visits, intensive outpatient encounters or partial hospitalization.\n\nThe Intake Period: January 1-November 15 of the measurement year. The Intake Period is used to capture new episodes of Alcohol or Drug Dependence. The November 15 cut-off date ensures that all services can occur before the measurement period ends.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "GUIDE",
      "value": "The new episode of alcohol and other drug dependence should be the first episode of the measurement period that is not preceded in the 60 days prior by another episode of alcohol or other drug dependence.",
      "name": "Guidance",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "GUIDE",
        "title": "Guidance"
      },
      "value_obj": {
        "type": "ED",
        "value": "The new episode of alcohol and other drug dependence should be the first episode of the measurement period that is not preceded in the 60 days prior by another episode of alcohol or other drug dependence.",
        "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": "Patients age 13 years of age and older who were diagnosed with a new episode of alcohol, opioid, or other drug abuse or dependency during a visit between January 1 and November 15 of the measurement period",
      "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": "Patients age 13 years of age and older who were diagnosed with a new episode of alcohol, opioid, or other drug abuse or dependency during a visit between January 1 and November 15 of the measurement period",
        "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": "Patients with a previous active diagnosis of alcohol, opioid or other drug abuse or dependence in the 60 days prior to the first episode of alcohol or drug dependence\n\nExclude patients whose hospice care overlaps the measurement period.",
      "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": "Patients with a previous active diagnosis of alcohol, opioid or other drug abuse or dependence in the 60 days prior to the first episode of alcohol or drug dependence\n\nExclude patients whose hospice care overlaps the measurement period.",
        "media_type": "text/plain"
      }
    },
    {
      "code": "NUMER",
      "value": "Numerator 1: Patients who initiated treatment within 14 days of the diagnosis\n\nNumerator 2: Patients who initiated treatment and who had two or more additional services with an alcohol, opioid, or other drug abuse or dependence diagnosis within 30 days of the initiation visit",
      "name": "Numerator",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "NUMER",
        "title": "Numerator"
      },
      "value_obj": {
        "type": "ED",
        "value": "Numerator 1: Patients who initiated treatment within 14 days of the diagnosis\n\nNumerator 2: Patients who initiated treatment and who had two or more additional services with an alcohol, opioid, or other drug abuse or dependence diagnosis within 30 days of the initiation visit",
        "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": "DENEXCEP",
      "value": "None",
      "name": "Denominator Exceptions",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "DENEXCEP",
        "title": "Denominator Exceptions"
      },
      "value_obj": {
        "type": "ED",
        "value": "None",
        "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": "201201010000",
      "inclusive?": true,
      "derived?": false
    },
    "high": {
      "type": "TS",
      "value": "201212312359",
      "inclusive?": true,
      "derived?": false
    },
    "width": {
      "type": "PQ",
      "unit": "a",
      "value": "1",
      "inclusive?": true,
      "derived?": false
    }
  },
  "measure_scoring": "PROPORTION",
  "population_criteria": {
    "IPP": {
      "conjunction?": true,
      "type": "IPP",
      "hqmf_id": "452021F9-5466-45A8-9528-0F92E70C95DD",
      "preconditions": [
        {
          "id": 2,
          "preconditions": [
            {
              "id": 1,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Initial_Population__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "DENOM": {
      "conjunction?": true,
      "type": "DENOM",
      "hqmf_id": "39C79E71-7369-46C3-AD5F-1C5D83BA474A",
      "preconditions": [
        {
          "id": 4,
          "preconditions": [
            {
              "id": 3,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Denominator__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "NUMER": {
      "conjunction?": true,
      "type": "NUMER",
      "hqmf_id": "22DE67FC-79C0-4725-BDE3-3C9B0A1ACAF7",
      "preconditions": [
        {
          "id": 6,
          "preconditions": [
            {
              "id": 5,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Numerator__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "DENEX": {
      "conjunction?": true,
      "type": "DENEX",
      "hqmf_id": "B0687FEA-DC33-40B2-95F7-279E11E3AB28",
      "preconditions": [
        {
          "id": 8,
          "preconditions": [
            {
              "id": 7,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Denominator_Exclusions__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "atLeastOneTrue"
        }
      ]
    },
    "STRAT": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "F7764C47-6BAE-4359-A3DF-9C452DC95A33",
      "preconditions": [
        {
          "id": 12,
          "preconditions": [
            {
              "id": 11,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Stratification_1__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "STRAT_1": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "44729C98-B535-4C78-8BC3-A716323B9965",
      "preconditions": [
        {
          "id": 16,
          "preconditions": [
            {
              "id": 15,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Stratification_2__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "IPP_1": {
      "conjunction?": true,
      "type": "IPP",
      "hqmf_id": "C7127400-8034-45D1-8227-6C244349AB6E",
      "preconditions": [
        {
          "id": 18,
          "preconditions": [
            {
              "id": 17,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Initial_Population__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "DENOM_1": {
      "conjunction?": true,
      "type": "DENOM",
      "hqmf_id": "B636C467-23C5-4A23-8709-C71641B1A3AE",
      "preconditions": [
        {
          "id": 20,
          "preconditions": [
            {
              "id": 19,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Denominator__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "NUMER_1": {
      "conjunction?": true,
      "type": "NUMER",
      "hqmf_id": "C3D3C7F3-CADA-45E9-A5AA-A05A3C04A76A",
      "preconditions": [
        {
          "id": 22,
          "preconditions": [
            {
              "id": 21,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Numerator_2__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "DENEX_1": {
      "conjunction?": true,
      "type": "DENEX",
      "hqmf_id": "089CFF04-2838-4B37-8BDA-647E7B94C709",
      "preconditions": [
        {
          "id": 24,
          "preconditions": [
            {
              "id": 23,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Denominator_Exclusions__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "atLeastOneTrue"
        }
      ]
    },
    "STRAT_2": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "2A93884C-D881-447F-BA9B-F2EA0A2F30F4",
      "preconditions": [
        {
          "id": 28,
          "preconditions": [
            {
              "id": 27,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Stratification_1__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "STRAT_3": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "7ECED382-8389-4028-9623-36ED3537E010",
      "preconditions": [
        {
          "id": 32,
          "preconditions": [
            {
              "id": 31,
              "reference": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment__Stratification_2__AFF126DD_D43A_4987_8EF9_A2E2CAE6AD0E"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    }
  },
  "population_sets": [
    {
      "population_set_id": "PopulationCriteria1",
      "populations": {
        "DENEX": {
          "hqmf_id": "B0687FEA-DC33-40B2-95F7-279E11E3AB28",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Denominator Exclusions"
        },
        "DENOM": {
          "hqmf_id": "39C79E71-7369-46C3-AD5F-1C5D83BA474A",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Denominator"
        },
        "IPP": {
          "hqmf_id": "452021F9-5466-45A8-9528-0F92E70C95DD",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Initial Population"
        },
        "NUMER": {
          "hqmf_id": "22DE67FC-79C0-4725-BDE3-3C9B0A1ACAF7",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Numerator"
        },
        "_type": "CQM::ProportionPopulationMap"
      },
      "stratifications": [
        {
          "hqmf_id": "F7764C47-6BAE-4359-A3DF-9C452DC95A33",
          "statement": {
            "hqmf_id": "F7764C47-6BAE-4359-A3DF-9C452DC95A33",
            "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
            "statement_name": "Stratification 1"
          },
          "stratification_id": "PopulationCriteria1 - Stratification 1",
          "title": "Stratification 1"
        },
        {
          "hqmf_id": "44729C98-B535-4C78-8BC3-A716323B9965",
          "statement": {
            "hqmf_id": "44729C98-B535-4C78-8BC3-A716323B9965",
            "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
            "statement_name": "Stratification 2"
          },
          "stratification_id": "PopulationCriteria1 - Stratification 2",
          "title": "Stratification 2"
        }
      ],
      "title": "Population Criteria Section 1"
    },
    {
      "population_set_id": "PopulationCriteria2",
      "populations": {
        "DENEX": {
          "hqmf_id": "089CFF04-2838-4B37-8BDA-647E7B94C709",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Denominator Exclusions"
        },
        "DENOM": {
          "hqmf_id": "B636C467-23C5-4A23-8709-C71641B1A3AE",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Denominator"
        },
        "IPP": {
          "hqmf_id": "C7127400-8034-45D1-8227-6C244349AB6E",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Initial Population"
        },
        "NUMER": {
          "hqmf_id": "C3D3C7F3-CADA-45E9-A5AA-A05A3C04A76A",
          "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
          "statement_name": "Numerator 2"
        },
        "_type": "CQM::ProportionPopulationMap"
      },
      "stratifications": [
        {
          "hqmf_id": "2A93884C-D881-447F-BA9B-F2EA0A2F30F4",
          "statement": {
            "hqmf_id": "2A93884C-D881-447F-BA9B-F2EA0A2F30F4",
            "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
            "statement_name": "Stratification 1"
          },
          "stratification_id": "PopulationCriteria2 - Stratification 1",
          "title": "Stratification 1"
        },
        {
          "hqmf_id": "7ECED382-8389-4028-9623-36ED3537E010",
          "statement": {
            "hqmf_id": "7ECED382-8389-4028-9623-36ED3537E010",
            "library_name": "InitiationandEngagementofAlcoholandOtherDrugDependenceTreatment",
            "statement_name": "Stratification 2"
          },
          "stratification_id": "PopulationCriteria2 - Stratification 2",
          "title": "Stratification 2"
        }
      ],
      "title": "Population Criteria Section 2"
    }
  ],
  "source_data_criteria": [
    {
      "codeListId": "2.16.840.1.114222.4.11.3591",
      "dataElementCodes": [

      ],
      "description": "Patient Characteristic Payer: Payer",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.58",
      "id": "5d289cbf31fe5f8b54b9ceb2",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "payer",
      "qdmTitle": "Patient Characteristic Payer",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::PatientCharacteristicPayer"
    },
    {
      "codeListId": "2.16.840.1.113762.1.4.1",
      "dataElementCodes": [

      ],
      "description": "Patient Characteristic Sex: ONCAdministrativeSex",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.55",
      "id": "5d289cbf31fe5f8b54b9ceb3",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "gender",
      "qdmTitle": "Patient Characteristic Sex",
      "qdmVersion": "5.5",
      "_type": "QDM::PatientCharacteristicSex"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.526.3.1496",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: PsychVisit-Psychotherapy",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9ceb4",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "anatomicalLocationSite": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.106.12.1001",
      "dataElementCodes": [

      ],
      "description": "Diagnosis: AlcoholandDrugDependence",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.110",
      "id": "5d289cbf31fe5f8b54b9ceb5",
      "prevalencePeriod": null,
      "qdmCategory": "condition",
      "qdmTitle": "Diagnosis",
      "qdmVersion": "5.5",
      "qrdaOid": "2.16.840.1.113883.10.20.24.3.135",
      "recorder": null,
      "severity": null,
      "_type": "QDM::Diagnosis"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.666.5.307",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: EncounterInpatient",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9ceb6",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1059",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: DetoxificationVisit",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9ceb7",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113762.1.4.1108.15",
      "dataElementCodes": [

      ],
      "description": "Intervention, Order: Hospicecareambulatory",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.35",
      "id": "5d289cbf31fe5f8b54b9ceb8",
      "negationRationale": null,
      "qdmCategory": "intervention",
      "qdmStatus": "order",
      "qdmTitle": "Intervention, Order",
      "qdmVersion": "5.5",
      "reason": null,
      "requester": null,
      "_type": "QDM::InterventionOrder"
    },
    {
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113762.1.4.1108.15",
      "dataElementCodes": [

      ],
      "description": "Intervention, Performed: Hospicecareambulatory",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.36",
      "id": "5d289cbf31fe5f8b54b9ceb9",
      "negationRationale": null,
      "performer": null,
      "qdmCategory": "intervention",
      "qdmStatus": "performed",
      "qdmTitle": "Intervention, Performed",
      "qdmVersion": "5.5",
      "reason": null,
      "relevantDatetime": null,
      "relevantPeriod": null,
      "result": null,
      "status": null,
      "_type": "QDM::InterventionPerformed"
    },
    {
      "codeListId": "2.16.840.1.114222.4.11.837",
      "dataElementCodes": [

      ],
      "description": "Patient Characteristic Ethnicity: Ethnicity",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.56",
      "id": "5d289cbf31fe5f8b54b9ceba",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "ethnicity",
      "qdmTitle": "Patient Characteristic Ethnicity",
      "qdmVersion": "5.5",
      "_type": "QDM::PatientCharacteristicEthnicity"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1007",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: DischargeServices-HospitalInpatient",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cebb",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1002",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: HospitalObservationCare-Initial",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cebc",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "codeListId": "2.16.840.1.114222.4.11.836",
      "dataElementCodes": [

      ],
      "description": "Patient Characteristic Race: Race",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.59",
      "id": "5d289cbf31fe5f8b54b9cebd",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "race",
      "qdmTitle": "Patient Characteristic Race",
      "qdmVersion": "5.5",
      "_type": "QDM::PatientCharacteristicRace"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1006",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: DischargeServices-HospitalInpatientSameDayDischarge",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cebe",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1010",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: EmergencyDepartmentVisit",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cebf",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1004",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: HospitalInpatientVisit-Initial",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cec0",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.106.12.1005",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: AlcoholandDrugDependenceTreatment",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cec1",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1001",
      "dataElementCodes": [

      ],
      "description": "Encounter, Performed: OfficeVisit",
      "diagnoses": null,
      "dischargeDisposition": null,
      "facilityLocations": [

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d289cbf31fe5f8b54b9cec2",
      "lengthOfStay": null,
      "negationRationale": null,
      "participant": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    }
  ],
  "title": "Initiation and Engagement of Alcohol and Other Drug Dependence Treatment",
  "updated_at": null,
  "value_set_ids": [
    "5d289cbf31fe5f8b54b9ce9c",
    "5d289cbf31fe5f8b54b9ce9d",
    "5d289cbf31fe5f8b54b9ce9e",
    "5d289cbf31fe5f8b54b9ce9f",
    "5d289cbf31fe5f8b54b9cea0",
    "5d289cbf31fe5f8b54b9cea1",
    "5d289cbf31fe5f8b54b9cea2",
    "5d289cbf31fe5f8b54b9cea3",
    "5d289cbf31fe5f8b54b9cea4",
    "5d289cbf31fe5f8b54b9cea5",
    "5d289cbf31fe5f8b54b9cea6",
    "5d289cbf31fe5f8b54b9cea7",
    "5d289cbf31fe5f8b54b9cea8",
    "5d289cbf31fe5f8b54b9cea9",
    "5d289cbf31fe5f8b54b9ceaa",
    "5d289cbf31fe5f8b54b9ceab",
    "5d289cbf31fe5f8b54b9ceac",
    "5d289cbf31fe5f8b54b9cead",
    "5d289cbf31fe5f8b54b9ceae",
    "5d289cbf31fe5f8b54b9ceaf",
    "5d289cbf31fe5f8b54b9ceb0",
    "5d289cbf31fe5f8b54b9ceb1"
  ]
}