{
  "_id": "5d48728057a11e8a91275c11",
  "calculate_sdes": null,
  "calculation_method": "EPISODE_OF_CARE",
  "cms_id": "CMS903v0",
  "component": false,
  "component_hqmf_set_ids": [

  ],
  "composite": false,
  "composite_hqmf_set_id": null,
  "cql_libraries": [
    {
      "_id": "5d48728057a11e8a91275c12",
      "cql": "library LikeCMS32 version '0.0.003'\n\n/*================================\neCQM ID: CMS902\nPatient-based: No\nScoring: continuous variable\nCMS Program Group: Eligible Hospitals (EH)\n================================*/\r\n\r\nusing QDM version '5.5'\r\n\r\ncodesystem \"SNOMEDCT\": 'urn:oid:2.16.840.1.113883.6.96'\r\n\r\nvalueset \"Discharge To Acute Care Facility\": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.87'\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 \"Ethnicity\": 'urn:oid:2.16.840.1.114222.4.11.837'\r\nvalueset \"Observation Services\": 'urn:oid:2.16.840.1.113762.1.4.1111.143'\r\nvalueset \"ONC Administrative Sex\": 'urn:oid:2.16.840.1.113762.1.4.1'\r\nvalueset \"Payer\": 'urn:oid:2.16.840.1.114222.4.11.3591'\r\nvalueset \"Psychiatric/Mental Health Diagnosis\": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.299'\r\nvalueset \"Race\": 'urn:oid:2.16.840.1.114222.4.11.836'\r\n\r\ncode \"Patient deceased during stay (discharge status = dead) (finding)\": '371828006' from \"SNOMEDCT\" display 'Patient deceased during stay (discharge status = dead) (finding)'\r\n\r\nparameter \"Measurement Period\" Interval<DateTime>\r\n\r\ncontext Patient\r\n\r\ndefine \"SDE Ethnicity\":\r\n  [\"Patient Characteristic Ethnicity\": \"Ethnicity\"]\r\n\r\ndefine \"SDE Payer\":\r\n  [\"Patient Characteristic Payer\": \"Payer\"]\r\n\r\ndefine \"SDE Race\":\r\n  [\"Patient Characteristic Race\": \"Race\"]\r\n\r\ndefine \"SDE Sex\":\r\n  [\"Patient Characteristic Sex\": \"ONC Administrative Sex\"]\r\n\r\ndefine \"Emergency Department ED Visit\":\r\n  [\"Encounter, Performed\": \"Emergency Department Visit\"] EDVisit\r\n    where EDVisit.relevantPeriod during \"Measurement Period\"\r\n\r\ndefine \"Strat2\":\r\n  \"Emergency Department ED Visit\" EDVisit\r\n    where EDVisit.dischargeDisposition in \"Discharge To Acute Care Facility\"\r\n\r\ndefine \"Initial Population\":\r\n  [\"Encounter, Performed\": \"Emergency Department Visit\"] EDVisit\r\n    where EDVisit.relevantPeriod during \"Measurement Period\"\r\n\r\ndefine \"Measure Population\":\r\n  \"Initial Population\" EDVisit\r\n    where \"Measure Observation\"(EDVisit)is not null\r\n\r\ndefine \"Measure Population Exclusions\":\r\n  ( \"Emergency Department ED Visit\" EDVisit\r\n      where EDVisit.dischargeDisposition ~ \"Patient deceased during stay (discharge status = dead) (finding)\"\r\n  )\r\n    union ( \"Emergency Department ED Visit\" EDVisit\r\n        with [\"Encounter, Performed\": \"Encounter Inpatient\"] Encounter\r\n          such that EDVisit.relevantPeriod ends 1 hour or less before or on start of Encounter.relevantPeriod\r\n    )\r\n\r\ndefine \"Strat1\":\r\n  \"Emergency Department ED Visit\" EDVisit\r\n    where exists ( EDVisit.diagnoses Diag\r\n        where Diag.rank = 1\r\n          and Diag.code in \"Psychiatric/Mental Health Diagnosis\"\r\n    )\r\n\r\ndefine \"Strat3\":\r\n  \"Emergency Department ED Visit\" EDVisit\r\n    let DiagCode: GetPrincipalDiagnosisCode(EDVisit)\r\n    where ( DiagCode is null\r\n        or not ( DiagCode in \"Psychiatric/Mental Health Diagnosis\" )\r\n    )\r\n      and not ( EDVisit.dischargeDisposition in \"Discharge To Acute Care Facility\" )\r\n\r\ndefine function \"Observation Services Order\"(Enc \"Encounter, Performed\"):\r\n  Last([\"Encounter, Order\": \"Observation Services\"] ObservationOrder\r\n      where ObservationOrder.authorDatetime during Enc.relevantPeriod\r\n      sort by authorDatetime\r\n  )\r\n\r\ndefine function \"Departure Time\"(Enc \"Encounter, Performed\"):\r\n  Last(Enc.facilityLocations Location\r\n      return \r\n      end of Location.locationPeriod\r\n      sort ascending\r\n  )\r\n\r\ndefine function \"Measure Observation\"(Enc \"Encounter, Performed\"):\r\n  \"Arrival to Observation Order or Departure Time\"(Enc)\r\n\r\ndefine function \"ArrivalTime\"(Enc \"Encounter, Performed\"):\r\n  First(Enc.facilityLocations Location\r\n      return start of Location.locationPeriod\r\n      sort ascending\r\n  )\r\n\r\ndefine function \"Arrival to Observation Order or Departure Time\"(Enc \"Encounter, Performed\"):\r\n  duration in minutes of Interval[\"ArrivalTime\"(Enc), Coalesce(\"Observation Services Order\"(Enc).authorDatetime, \"Departure Time\"(Enc))]\r\n\r\ndefine function \"GetPrincipalDiagnosisCode\"(Enc \"Encounter, Performed\"):\r\n  singleton from ( Enc.diagnoses Diag\r\n      where Diag.rank = 1\r\n      return Diag.code\r\n  )",
      "elm": {
        "library": {
          "identifier": {
            "id": "LikeCMS32",
            "version": "0.0.003"
          },
          "schemaIdentifier": {
            "id": "urn:hl7-org:elm",
            "version": "r1"
          },
          "usings": {
            "def": [
              {
                "localIdentifier": "System",
                "uri": "urn:hl7-org:elm-types:r1"
              },
              {
                "localId": "1",
                "locator": "10:1-10:23",
                "localIdentifier": "QDM",
                "uri": "urn:healthit-gov:qdm:v5_5",
                "version": "5.5"
              }
            ]
          },
          "parameters": {
            "def": [
              {
                "localId": "16",
                "locator": "26:1-26:49",
                "name": "Measurement Period",
                "accessLevel": "Public",
                "parameterTypeSpecifier": {
                  "localId": "15",
                  "locator": "26:32-26:49",
                  "type": "IntervalTypeSpecifier",
                  "pointType": {
                    "localId": "14",
                    "locator": "26:41-26:48",
                    "name": "{urn:hl7-org:elm-types:r1}DateTime",
                    "type": "NamedTypeSpecifier"
                  }
                }
              }
            ]
          },
          "codeSystems": {
            "def": [
              {
                "localId": "2",
                "locator": "12:1-12:55",
                "name": "SNOMEDCT",
                "id": "2.16.840.1.113883.6.96",
                "accessLevel": "Public"
              }
            ]
          },
          "valueSets": {
            "def": [
              {
                "localId": "3",
                "locator": "14:1-14:87",
                "name": "Discharge To Acute Care Facility",
                "id": "2.16.840.1.113883.3.117.1.7.1.87",
                "accessLevel": "Public"
              },
              {
                "localId": "4",
                "locator": "15:1-15:82",
                "name": "Emergency Department Visit",
                "id": "2.16.840.1.113883.3.117.1.7.1.292",
                "accessLevel": "Public"
              },
              {
                "localId": "5",
                "locator": "16:1-16:71",
                "name": "Encounter Inpatient",
                "id": "2.16.840.1.113883.3.666.5.307",
                "accessLevel": "Public"
              },
              {
                "localId": "6",
                "locator": "17:1-17:58",
                "name": "Ethnicity",
                "id": "2.16.840.1.114222.4.11.837",
                "accessLevel": "Public"
              },
              {
                "localId": "7",
                "locator": "18:1-18:73",
                "name": "Observation Services",
                "id": "2.16.840.1.113762.1.4.1111.143",
                "accessLevel": "Public"
              },
              {
                "localId": "8",
                "locator": "19:1-19:68",
                "name": "ONC Administrative Sex",
                "id": "2.16.840.1.113762.1.4.1",
                "accessLevel": "Public"
              },
              {
                "localId": "9",
                "locator": "20:1-20:55",
                "name": "Payer",
                "id": "2.16.840.1.114222.4.11.3591",
                "accessLevel": "Public"
              },
              {
                "localId": "10",
                "locator": "21:1-21:91",
                "name": "Psychiatric/Mental Health Diagnosis",
                "id": "2.16.840.1.113883.3.117.1.7.1.299",
                "accessLevel": "Public"
              },
              {
                "localId": "11",
                "locator": "22:1-22:53",
                "name": "Race",
                "id": "2.16.840.1.114222.4.11.836",
                "accessLevel": "Public"
              }
            ]
          },
          "codes": {
            "def": [
              {
                "localId": "13",
                "locator": "24:1-24:175",
                "name": "Patient deceased during stay (discharge status = dead) (finding)",
                "id": "371828006",
                "display": "Patient deceased during stay (discharge status = dead) (finding)",
                "accessLevel": "Public",
                "codeSystem": {
                  "localId": "12",
                  "locator": "24:91-24:100",
                  "name": "SNOMEDCT"
                }
              }
            ]
          },
          "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_5}Patient",
                    "templateId": "Patient",
                    "type": "Retrieve"
                  }
                }
              },
              {
                "localId": "18",
                "locator": "30:1-31:51",
                "name": "SDE Ethnicity",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "18",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Ethnicity\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "17",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Ethnicity\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Ethnicity\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "17",
                  "locator": "31:3-31:51",
                  "dataType": "{urn:healthit-gov:qdm:v5_5}PatientCharacteristicEthnicity",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "locator": "31:40-31:50",
                    "name": "Ethnicity",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "20",
                "locator": "33:1-34:43",
                "name": "SDE Payer",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "20",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Payer\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "19",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Payer\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Payer\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "19",
                  "locator": "34:3-34:43",
                  "dataType": "{urn:healthit-gov:qdm:v5_5}PatientCharacteristicPayer",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "locator": "34:36-34:42",
                    "name": "Payer",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "22",
                "locator": "36:1-37:41",
                "name": "SDE Race",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "22",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Race\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "21",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Race\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"Race\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "21",
                  "locator": "37:3-37:41",
                  "dataType": "{urn:healthit-gov:qdm:v5_5}PatientCharacteristicRace",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "locator": "37:35-37:40",
                    "name": "Race",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "24",
                "locator": "39:1-40:58",
                "name": "SDE Sex",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "24",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"SDE Sex\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "23",
                          "s": [
                            {
                              "value": [
                                "[",
                                "\"Patient Characteristic Sex\"",
                                ": "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "\"ONC Administrative Sex\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "]"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "23",
                  "locator": "40:3-40:58",
                  "dataType": "{urn:healthit-gov:qdm:v5_5}PatientCharacteristicSex",
                  "codeProperty": "code",
                  "type": "Retrieve",
                  "codes": {
                    "locator": "40:34-40:57",
                    "name": "ONC Administrative Sex",
                    "type": "ValueSetRef"
                  }
                }
              },
              {
                "localId": "32",
                "locator": "42:1-44:60",
                "name": "Emergency Department ED Visit",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "32",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Emergency Department ED Visit\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "31",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "26",
                                  "s": [
                                    {
                                      "r": "25",
                                      "s": [
                                        {
                                          "r": "25",
                                          "s": [
                                            {
                                              "value": [
                                                "[",
                                                "\"Encounter, Performed\"",
                                                ": "
                                              ]
                                            },
                                            {
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Emergency Department Visit\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "]"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EDVisit"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "30",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "30",
                                  "s": [
                                    {
                                      "r": "28",
                                      "s": [
                                        {
                                          "r": "27",
                                          "s": [
                                            {
                                              "value": [
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "."
                                          ]
                                        },
                                        {
                                          "r": "28",
                                          "s": [
                                            {
                                              "value": [
                                                "relevantPeriod"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "r": "30",
                                      "value": [
                                        " ",
                                        "during",
                                        " "
                                      ]
                                    },
                                    {
                                      "r": "29",
                                      "s": [
                                        {
                                          "value": [
                                            "\"Measurement Period\""
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "31",
                  "locator": "43:3-44:60",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "26",
                      "locator": "43:3-43:64",
                      "alias": "EDVisit",
                      "expression": {
                        "localId": "25",
                        "locator": "43:3-43:56",
                        "dataType": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                        "templateId": "PositiveEncounterPerformed",
                        "codeProperty": "code",
                        "type": "Retrieve",
                        "codes": {
                          "locator": "43:28-43:55",
                          "name": "Emergency Department Visit",
                          "type": "ValueSetRef"
                        }
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "30",
                    "locator": "44:5-44:60",
                    "type": "IncludedIn",
                    "operand": [
                      {
                        "localId": "28",
                        "locator": "44:11-44:32",
                        "path": "relevantPeriod",
                        "scope": "EDVisit",
                        "type": "Property"
                      },
                      {
                        "localId": "29",
                        "locator": "44:41-44:60",
                        "name": "Measurement Period",
                        "type": "ParameterRef"
                      }
                    ]
                  }
                }
              },
              {
                "localId": "40",
                "locator": "46:1-48:76",
                "name": "Strat2",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "40",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Strat2\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "39",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "34",
                                  "s": [
                                    {
                                      "r": "33",
                                      "s": [
                                        {
                                          "s": [
                                            {
                                              "value": [
                                                "\"Emergency Department ED Visit\""
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EDVisit"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "38",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "38",
                                  "s": [
                                    {
                                      "r": "36",
                                      "s": [
                                        {
                                          "r": "35",
                                          "s": [
                                            {
                                              "value": [
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "."
                                          ]
                                        },
                                        {
                                          "r": "36",
                                          "s": [
                                            {
                                              "value": [
                                                "dischargeDisposition"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " in "
                                      ]
                                    },
                                    {
                                      "r": "37",
                                      "s": [
                                        {
                                          "value": [
                                            "\"Discharge To Acute Care Facility\""
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "39",
                  "locator": "47:3-48:76",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "34",
                      "locator": "47:3-47:41",
                      "alias": "EDVisit",
                      "expression": {
                        "localId": "33",
                        "locator": "47:3-47:33",
                        "name": "Emergency Department ED Visit",
                        "type": "ExpressionRef"
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "38",
                    "locator": "48:5-48:76",
                    "type": "InValueSet",
                    "code": {
                      "localId": "36",
                      "locator": "48:11-48:38",
                      "path": "dischargeDisposition",
                      "scope": "EDVisit",
                      "type": "Property"
                    },
                    "valueset": {
                      "localId": "37",
                      "locator": "48:43-48:76",
                      "name": "Discharge To Acute Care Facility"
                    }
                  }
                }
              },
              {
                "localId": "48",
                "locator": "50:1-52:60",
                "name": "Initial Population",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "48",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Initial Population\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "47",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "42",
                                  "s": [
                                    {
                                      "r": "41",
                                      "s": [
                                        {
                                          "r": "41",
                                          "s": [
                                            {
                                              "value": [
                                                "[",
                                                "\"Encounter, Performed\"",
                                                ": "
                                              ]
                                            },
                                            {
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Emergency Department Visit\""
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "]"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EDVisit"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "46",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "46",
                                  "s": [
                                    {
                                      "r": "44",
                                      "s": [
                                        {
                                          "r": "43",
                                          "s": [
                                            {
                                              "value": [
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "."
                                          ]
                                        },
                                        {
                                          "r": "44",
                                          "s": [
                                            {
                                              "value": [
                                                "relevantPeriod"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "r": "46",
                                      "value": [
                                        " ",
                                        "during",
                                        " "
                                      ]
                                    },
                                    {
                                      "r": "45",
                                      "s": [
                                        {
                                          "value": [
                                            "\"Measurement Period\""
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "47",
                  "locator": "51:3-52:60",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "42",
                      "locator": "51:3-51:64",
                      "alias": "EDVisit",
                      "expression": {
                        "localId": "41",
                        "locator": "51:3-51:56",
                        "dataType": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                        "templateId": "PositiveEncounterPerformed",
                        "codeProperty": "code",
                        "type": "Retrieve",
                        "codes": {
                          "locator": "51:28-51:55",
                          "name": "Emergency Department Visit",
                          "type": "ValueSetRef"
                        }
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "46",
                    "locator": "52:5-52:60",
                    "type": "IncludedIn",
                    "operand": [
                      {
                        "localId": "44",
                        "locator": "52:11-52:32",
                        "path": "relevantPeriod",
                        "scope": "EDVisit",
                        "type": "Property"
                      },
                      {
                        "localId": "45",
                        "locator": "52:41-52:60",
                        "name": "Measurement Period",
                        "type": "ParameterRef"
                      }
                    ]
                  }
                }
              },
              {
                "localId": "66",
                "locator": "98:1-102:3",
                "name": "ArrivalTime",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "66",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"ArrivalTime\"",
                            "(",
                            "Enc",
                            " "
                          ]
                        },
                        {
                          "r": "56",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "65",
                          "s": [
                            {
                              "r": "65",
                              "s": [
                                {
                                  "value": [
                                    "First",
                                    "("
                                  ]
                                },
                                {
                                  "r": "64",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "58",
                                          "s": [
                                            {
                                              "r": "57",
                                              "s": [
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Enc",
                                                        ".",
                                                        "facilityLocations"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "Location"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "r": "62",
                                      "s": [
                                        {
                                          "value": [
                                            "return "
                                          ]
                                        },
                                        {
                                          "r": "61",
                                          "s": [
                                            {
                                              "value": [
                                                "start of "
                                              ]
                                            },
                                            {
                                              "r": "60",
                                              "s": [
                                                {
                                                  "r": "59",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Location"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "60",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "locationPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "r": "63",
                                      "value": [
                                        "\n      ",
                                        "sort ascending"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n  )"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "65",
                  "locator": "99:3-102:3",
                  "type": "First",
                  "source": {
                    "localId": "64",
                    "locator": "99:9-101:20",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "58",
                        "locator": "99:9-99:38",
                        "alias": "Location",
                        "expression": {
                          "localId": "57",
                          "locator": "99:9-99:29",
                          "path": "facilityLocations",
                          "type": "Property",
                          "source": {
                            "name": "Enc",
                            "type": "OperandRef"
                          }
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "return": {
                      "localId": "62",
                      "locator": "100:7-100:45",
                      "expression": {
                        "localId": "61",
                        "locator": "100:14-100:45",
                        "type": "Start",
                        "operand": {
                          "localId": "60",
                          "locator": "100:23-100:45",
                          "path": "locationPeriod",
                          "scope": "Location",
                          "type": "Property"
                        }
                      }
                    },
                    "sort": {
                      "localId": "63",
                      "locator": "101:7-101:20",
                      "by": [
                        {
                          "direction": "asc",
                          "type": "ByDirection"
                        }
                      ]
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Enc",
                    "operandTypeSpecifier": {
                      "localId": "56",
                      "locator": "98:35-98:56",
                      "name": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "82",
                "locator": "82:1-86:3",
                "name": "Observation Services Order",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "82",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Observation Services Order\"",
                            "(",
                            "Enc",
                            " "
                          ]
                        },
                        {
                          "r": "69",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "81",
                          "s": [
                            {
                              "r": "81",
                              "s": [
                                {
                                  "value": [
                                    "Last",
                                    "("
                                  ]
                                },
                                {
                                  "r": "80",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "71",
                                          "s": [
                                            {
                                              "r": "70",
                                              "s": [
                                                {
                                                  "r": "70",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Encounter, Order\"",
                                                        ": "
                                                      ]
                                                    },
                                                    {
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Observation Services\""
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "ObservationOrder"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "r": "76",
                                      "s": [
                                        {
                                          "value": [
                                            "where "
                                          ]
                                        },
                                        {
                                          "r": "76",
                                          "s": [
                                            {
                                              "r": "73",
                                              "s": [
                                                {
                                                  "r": "72",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "ObservationOrder"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "73",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "authorDatetime"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "r": "76",
                                              "value": [
                                                " ",
                                                "during",
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "75",
                                              "s": [
                                                {
                                                  "r": "74",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Enc"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "75",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "relevantPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "r": "79",
                                      "s": [
                                        {
                                          "value": [
                                            "sort by "
                                          ]
                                        },
                                        {
                                          "r": "78",
                                          "s": [
                                            {
                                              "r": "77",
                                              "s": [
                                                {
                                                  "value": [
                                                    "authorDatetime"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n  )"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "81",
                  "locator": "83:3-86:3",
                  "type": "Last",
                  "source": {
                    "localId": "80",
                    "locator": "83:8-85:28",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "71",
                        "locator": "83:8-83:68",
                        "alias": "ObservationOrder",
                        "expression": {
                          "localId": "70",
                          "locator": "83:8-83:51",
                          "dataType": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterOrder",
                          "templateId": "PositiveEncounterOrder",
                          "codeProperty": "code",
                          "type": "Retrieve",
                          "codes": {
                            "locator": "83:29-83:50",
                            "name": "Observation Services",
                            "type": "ValueSetRef"
                          }
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "where": {
                      "localId": "76",
                      "locator": "84:7-84:69",
                      "type": "In",
                      "operand": [
                        {
                          "localId": "73",
                          "locator": "84:13-84:43",
                          "path": "authorDatetime",
                          "scope": "ObservationOrder",
                          "type": "Property"
                        },
                        {
                          "localId": "75",
                          "locator": "84:52-84:69",
                          "path": "relevantPeriod",
                          "type": "Property",
                          "source": {
                            "localId": "74",
                            "locator": "84:52-84:54",
                            "name": "Enc",
                            "type": "OperandRef"
                          }
                        }
                      ]
                    },
                    "sort": {
                      "localId": "79",
                      "locator": "85:7-85:28",
                      "by": [
                        {
                          "localId": "78",
                          "locator": "85:15-85:28",
                          "direction": "asc",
                          "path": "authorDatetime",
                          "type": "ByColumn"
                        }
                      ]
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Enc",
                    "operandTypeSpecifier": {
                      "localId": "69",
                      "locator": "82:50-82:71",
                      "name": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "96",
                "locator": "88:1-93:3",
                "name": "Departure Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "96",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Departure Time\"",
                            "(",
                            "Enc",
                            " "
                          ]
                        },
                        {
                          "r": "86",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "95",
                          "s": [
                            {
                              "r": "95",
                              "s": [
                                {
                                  "value": [
                                    "Last",
                                    "("
                                  ]
                                },
                                {
                                  "r": "94",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "88",
                                          "s": [
                                            {
                                              "r": "87",
                                              "s": [
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Enc",
                                                        ".",
                                                        "facilityLocations"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "Location"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "r": "92",
                                      "s": [
                                        {
                                          "value": [
                                            "return \n      "
                                          ]
                                        },
                                        {
                                          "r": "91",
                                          "s": [
                                            {
                                              "value": [
                                                "end of "
                                              ]
                                            },
                                            {
                                              "r": "90",
                                              "s": [
                                                {
                                                  "r": "89",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Location"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "90",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "locationPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "r": "93",
                                      "value": [
                                        "\n      ",
                                        "sort ascending"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n  )"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "95",
                  "locator": "89:3-93:3",
                  "type": "Last",
                  "source": {
                    "localId": "94",
                    "locator": "89:8-92:20",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "88",
                        "locator": "89:8-89:37",
                        "alias": "Location",
                        "expression": {
                          "localId": "87",
                          "locator": "89:8-89:28",
                          "path": "facilityLocations",
                          "type": "Property",
                          "source": {
                            "name": "Enc",
                            "type": "OperandRef"
                          }
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "return": {
                      "localId": "92",
                      "locator": "90:7-91:36",
                      "expression": {
                        "localId": "91",
                        "locator": "91:7-91:36",
                        "type": "End",
                        "operand": {
                          "localId": "90",
                          "locator": "91:14-91:36",
                          "path": "locationPeriod",
                          "scope": "Location",
                          "type": "Property"
                        }
                      }
                    },
                    "sort": {
                      "localId": "93",
                      "locator": "92:7-92:20",
                      "by": [
                        {
                          "direction": "asc",
                          "type": "ByDirection"
                        }
                      ]
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Enc",
                    "operandTypeSpecifier": {
                      "localId": "86",
                      "locator": "88:38-88:59",
                      "name": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "101",
                "locator": "104:1-105:136",
                "name": "Arrival to Observation Order or Departure Time",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "101",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Arrival to Observation Order or Departure Time\"",
                            "(",
                            "Enc",
                            " "
                          ]
                        },
                        {
                          "r": "54",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "100",
                          "s": [
                            {
                              "r": "100",
                              "s": [
                                {
                                  "value": [
                                    "duration in minutes of "
                                  ]
                                },
                                {
                                  "r": "99",
                                  "s": [
                                    {
                                      "value": [
                                        "Interval["
                                      ]
                                    },
                                    {
                                      "r": "67",
                                      "s": [
                                        {
                                          "value": [
                                            "\"ArrivalTime\"",
                                            "("
                                          ]
                                        },
                                        {
                                          "r": "55",
                                          "s": [
                                            {
                                              "value": [
                                                "Enc"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            ")"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        ", "
                                      ]
                                    },
                                    {
                                      "r": "98",
                                      "s": [
                                        {
                                          "value": [
                                            "Coalesce",
                                            "("
                                          ]
                                        },
                                        {
                                          "r": "84",
                                          "s": [
                                            {
                                              "r": "83",
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Observation Services Order\"",
                                                    "("
                                                  ]
                                                },
                                                {
                                                  "r": "68",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Enc"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    ")"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "."
                                              ]
                                            },
                                            {
                                              "r": "84",
                                              "s": [
                                                {
                                                  "value": [
                                                    "authorDatetime"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            ", "
                                          ]
                                        },
                                        {
                                          "r": "97",
                                          "s": [
                                            {
                                              "value": [
                                                "\"Departure Time\"",
                                                "("
                                              ]
                                            },
                                            {
                                              "r": "85",
                                              "s": [
                                                {
                                                  "value": [
                                                    "Enc"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ")"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            ")"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "]"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "100",
                  "locator": "105:3-105:136",
                  "precision": "Minute",
                  "type": "DurationBetween",
                  "operand": [
                    {
                      "type": "Start",
                      "operand": {
                        "localId": "99",
                        "locator": "105:26-105:136",
                        "lowClosed": true,
                        "highClosed": true,
                        "type": "Interval",
                        "low": {
                          "localId": "67",
                          "locator": "105:35-105:52",
                          "name": "ArrivalTime",
                          "type": "FunctionRef",
                          "operand": [
                            {
                              "localId": "55",
                              "locator": "105:49-105:51",
                              "name": "Enc",
                              "type": "OperandRef"
                            }
                          ]
                        },
                        "high": {
                          "localId": "98",
                          "locator": "105:55-105:135",
                          "type": "Coalesce",
                          "operand": [
                            {
                              "localId": "84",
                              "locator": "105:64-105:111",
                              "path": "authorDatetime",
                              "type": "Property",
                              "source": {
                                "localId": "83",
                                "locator": "105:64-105:96",
                                "name": "Observation Services Order",
                                "type": "FunctionRef",
                                "operand": [
                                  {
                                    "localId": "68",
                                    "locator": "105:93-105:95",
                                    "name": "Enc",
                                    "type": "OperandRef"
                                  }
                                ]
                              }
                            },
                            {
                              "localId": "97",
                              "locator": "105:114-105:134",
                              "name": "Departure Time",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "85",
                                  "locator": "105:131-105:133",
                                  "name": "Enc",
                                  "type": "OperandRef"
                                }
                              ]
                            }
                          ]
                        }
                      }
                    },
                    {
                      "type": "End",
                      "operand": {
                        "localId": "99",
                        "locator": "105:26-105:136",
                        "lowClosed": true,
                        "highClosed": true,
                        "type": "Interval",
                        "low": {
                          "localId": "67",
                          "locator": "105:35-105:52",
                          "name": "ArrivalTime",
                          "type": "FunctionRef",
                          "operand": [
                            {
                              "localId": "55",
                              "locator": "105:49-105:51",
                              "name": "Enc",
                              "type": "OperandRef"
                            }
                          ]
                        },
                        "high": {
                          "localId": "98",
                          "locator": "105:55-105:135",
                          "type": "Coalesce",
                          "operand": [
                            {
                              "localId": "84",
                              "locator": "105:64-105:111",
                              "path": "authorDatetime",
                              "type": "Property",
                              "source": {
                                "localId": "83",
                                "locator": "105:64-105:96",
                                "name": "Observation Services Order",
                                "type": "FunctionRef",
                                "operand": [
                                  {
                                    "localId": "68",
                                    "locator": "105:93-105:95",
                                    "name": "Enc",
                                    "type": "OperandRef"
                                  }
                                ]
                              }
                            },
                            {
                              "localId": "97",
                              "locator": "105:114-105:134",
                              "name": "Departure Time",
                              "type": "FunctionRef",
                              "operand": [
                                {
                                  "localId": "85",
                                  "locator": "105:131-105:133",
                                  "name": "Enc",
                                  "type": "OperandRef"
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "Enc",
                    "operandTypeSpecifier": {
                      "localId": "54",
                      "locator": "104:70-104:91",
                      "name": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "103",
                "locator": "95:1-96:55",
                "name": "Measure Observation",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "103",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"Measure Observation\"",
                            "(",
                            "Enc",
                            " "
                          ]
                        },
                        {
                          "r": "52",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "102",
                          "s": [
                            {
                              "r": "102",
                              "s": [
                                {
                                  "value": [
                                    "\"Arrival to Observation Order or Departure Time\"",
                                    "("
                                  ]
                                },
                                {
                                  "r": "53",
                                  "s": [
                                    {
                                      "value": [
                                        "Enc"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    ")"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "102",
                  "locator": "96:3-96:55",
                  "name": "Arrival to Observation Order or Departure Time",
                  "type": "FunctionRef",
                  "operand": [
                    {
                      "localId": "53",
                      "locator": "96:52-96:54",
                      "name": "Enc",
                      "type": "OperandRef"
                    }
                  ]
                },
                "operand": [
                  {
                    "name": "Enc",
                    "operandTypeSpecifier": {
                      "localId": "52",
                      "locator": "95:43-95:64",
                      "name": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "107",
                "locator": "54:1-56:51",
                "name": "Measure Population",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "107",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Measure Population\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "106",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "50",
                                  "s": [
                                    {
                                      "r": "49",
                                      "s": [
                                        {
                                          "s": [
                                            {
                                              "value": [
                                                "\"Initial Population\""
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EDVisit"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "105",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "105",
                                  "s": [
                                    {
                                      "r": "104",
                                      "s": [
                                        {
                                          "value": [
                                            "\"Measure Observation\"",
                                            "("
                                          ]
                                        },
                                        {
                                          "r": "51",
                                          "s": [
                                            {
                                              "value": [
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            ")"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "is not null"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "106",
                  "locator": "55:3-56:51",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "50",
                      "locator": "55:3-55:30",
                      "alias": "EDVisit",
                      "expression": {
                        "localId": "49",
                        "locator": "55:3-55:22",
                        "name": "Initial Population",
                        "type": "ExpressionRef"
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "105",
                    "locator": "56:5-56:51",
                    "type": "Not",
                    "operand": {
                      "locator": "56:11-56:51",
                      "type": "IsNull",
                      "operand": {
                        "localId": "104",
                        "locator": "56:11-56:40",
                        "name": "Measure Observation",
                        "type": "FunctionRef",
                        "operand": [
                          {
                            "localId": "51",
                            "locator": "56:33-56:39",
                            "name": "EDVisit",
                            "type": "AliasRef"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              {
                "localId": "129",
                "locator": "58:1-65:5",
                "name": "Measure Population Exclusions",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "129",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Measure Population Exclusions\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "128",
                          "s": [
                            {
                              "r": "114",
                              "s": [
                                {
                                  "value": [
                                    "( "
                                  ]
                                },
                                {
                                  "r": "114",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "109",
                                          "s": [
                                            {
                                              "r": "108",
                                              "s": [
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Emergency Department ED Visit\""
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "r": "113",
                                      "s": [
                                        {
                                          "value": [
                                            "where "
                                          ]
                                        },
                                        {
                                          "r": "113",
                                          "s": [
                                            {
                                              "r": "111",
                                              "s": [
                                                {
                                                  "r": "110",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "EDVisit"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "111",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "dischargeDisposition"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "~",
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "112",
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Patient deceased during stay (discharge status = dead) (finding)\""
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n  )"
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    union "
                              ]
                            },
                            {
                              "r": "127",
                              "s": [
                                {
                                  "value": [
                                    "( "
                                  ]
                                },
                                {
                                  "r": "127",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "116",
                                          "s": [
                                            {
                                              "r": "115",
                                              "s": [
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Emergency Department ED Visit\""
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n        "
                                      ]
                                    },
                                    {
                                      "r": "126",
                                      "s": [
                                        {
                                          "value": [
                                            "with "
                                          ]
                                        },
                                        {
                                          "r": "118",
                                          "s": [
                                            {
                                              "r": "117",
                                              "s": [
                                                {
                                                  "r": "117",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "[",
                                                        "\"Encounter, Performed\"",
                                                        ": "
                                                      ]
                                                    },
                                                    {
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Encounter Inpatient\""
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "]"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "Encounter"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n          such that "
                                          ]
                                        },
                                        {
                                          "r": "125",
                                          "s": [
                                            {
                                              "r": "120",
                                              "s": [
                                                {
                                                  "r": "119",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "EDVisit"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "120",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "relevantPeriod"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "125",
                                              "s": [
                                                {
                                                  "value": [
                                                    "ends "
                                                  ]
                                                },
                                                {
                                                  "r": "124",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "1 ",
                                                        "hour"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " or less before or on"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " "
                                              ]
                                            },
                                            {
                                              "r": "123",
                                              "s": [
                                                {
                                                  "value": [
                                                    "start of "
                                                  ]
                                                },
                                                {
                                                  "r": "122",
                                                  "s": [
                                                    {
                                                      "r": "121",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Encounter"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "122",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "relevantPeriod"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n    )"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "128",
                  "locator": "59:3-65:5",
                  "type": "Union",
                  "operand": [
                    {
                      "localId": "114",
                      "locator": "59:3-61:3",
                      "type": "Query",
                      "source": [
                        {
                          "localId": "109",
                          "locator": "59:5-59:43",
                          "alias": "EDVisit",
                          "expression": {
                            "localId": "108",
                            "locator": "59:5-59:35",
                            "name": "Emergency Department ED Visit",
                            "type": "ExpressionRef"
                          }
                        }
                      ],
                      "relationship": [

                      ],
                      "where": {
                        "localId": "113",
                        "locator": "60:7-60:109",
                        "type": "Equivalent",
                        "operand": [
                          {
                            "localId": "111",
                            "locator": "60:13-60:40",
                            "path": "dischargeDisposition",
                            "scope": "EDVisit",
                            "type": "Property"
                          },
                          {
                            "localId": "112",
                            "locator": "60:44-60:109",
                            "name": "Patient deceased during stay (discharge status = dead) (finding)",
                            "type": "CodeRef"
                          }
                        ]
                      }
                    },
                    {
                      "localId": "127",
                      "locator": "62:11-65:5",
                      "type": "Query",
                      "source": [
                        {
                          "localId": "116",
                          "locator": "62:13-62:51",
                          "alias": "EDVisit",
                          "expression": {
                            "localId": "115",
                            "locator": "62:13-62:43",
                            "name": "Emergency Department ED Visit",
                            "type": "ExpressionRef"
                          }
                        }
                      ],
                      "relationship": [
                        {
                          "localId": "126",
                          "locator": "63:9-64:109",
                          "alias": "Encounter",
                          "type": "With",
                          "expression": {
                            "localId": "117",
                            "locator": "63:14-63:60",
                            "dataType": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                            "templateId": "PositiveEncounterPerformed",
                            "codeProperty": "code",
                            "type": "Retrieve",
                            "codes": {
                              "locator": "63:39-63:59",
                              "name": "Encounter Inpatient",
                              "type": "ValueSetRef"
                            }
                          },
                          "suchThat": {
                            "localId": "125",
                            "locator": "64:21-64:109",
                            "type": "And",
                            "operand": [
                              {
                                "locator": "64:49-64:62",
                                "type": "In",
                                "operand": [
                                  {
                                    "locator": "64:44-64:47",
                                    "type": "End",
                                    "operand": {
                                      "localId": "120",
                                      "locator": "64:21-64:42",
                                      "path": "relevantPeriod",
                                      "scope": "EDVisit",
                                      "type": "Property"
                                    }
                                  },
                                  {
                                    "locator": "64:49-64:62",
                                    "lowClosed": true,
                                    "highClosed": true,
                                    "type": "Interval",
                                    "low": {
                                      "locator": "64:77-64:109",
                                      "type": "Subtract",
                                      "operand": [
                                        {
                                          "localId": "123",
                                          "locator": "64:77-64:109",
                                          "type": "Start",
                                          "operand": {
                                            "localId": "122",
                                            "locator": "64:86-64:109",
                                            "path": "relevantPeriod",
                                            "scope": "Encounter",
                                            "type": "Property"
                                          }
                                        },
                                        {
                                          "localId": "124",
                                          "locator": "64:49-64:54",
                                          "value": 1,
                                          "unit": "hour",
                                          "type": "Quantity"
                                        }
                                      ]
                                    },
                                    "high": {
                                      "localId": "123",
                                      "locator": "64:77-64:109",
                                      "type": "Start",
                                      "operand": {
                                        "localId": "122",
                                        "locator": "64:86-64:109",
                                        "path": "relevantPeriod",
                                        "scope": "Encounter",
                                        "type": "Property"
                                      }
                                    }
                                  }
                                ]
                              },
                              {
                                "locator": "64:49-64:62",
                                "type": "Not",
                                "operand": {
                                  "locator": "64:49-64:62",
                                  "type": "IsNull",
                                  "operand": {
                                    "localId": "123",
                                    "locator": "64:77-64:109",
                                    "type": "Start",
                                    "operand": {
                                      "localId": "122",
                                      "locator": "64:86-64:109",
                                      "path": "relevantPeriod",
                                      "scope": "Encounter",
                                      "type": "Property"
                                    }
                                  }
                                }
                              }
                            ]
                          }
                        }
                      ]
                    }
                  ]
                }
              },
              {
                "localId": "146",
                "locator": "67:1-72:5",
                "name": "Strat1",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "146",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Strat1\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "145",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "131",
                                  "s": [
                                    {
                                      "r": "130",
                                      "s": [
                                        {
                                          "s": [
                                            {
                                              "value": [
                                                "\"Emergency Department ED Visit\""
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EDVisit"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "144",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "144",
                                  "s": [
                                    {
                                      "value": [
                                        "exists "
                                      ]
                                    },
                                    {
                                      "r": "143",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "143",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "r": "133",
                                                  "s": [
                                                    {
                                                      "r": "132",
                                                      "s": [
                                                        {
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "EDVisit",
                                                                ".",
                                                                "diagnoses"
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        " ",
                                                        "Diag"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n        "
                                              ]
                                            },
                                            {
                                              "r": "142",
                                              "s": [
                                                {
                                                  "value": [
                                                    "where "
                                                  ]
                                                },
                                                {
                                                  "r": "142",
                                                  "s": [
                                                    {
                                                      "r": "137",
                                                      "s": [
                                                        {
                                                          "r": "135",
                                                          "s": [
                                                            {
                                                              "r": "134",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "Diag"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "135",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "rank"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "136",
                                                          "value": [
                                                            " ",
                                                            "=",
                                                            " ",
                                                            "1"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n          and "
                                                      ]
                                                    },
                                                    {
                                                      "r": "141",
                                                      "s": [
                                                        {
                                                          "r": "139",
                                                          "s": [
                                                            {
                                                              "r": "138",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "Diag"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "139",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "code"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            " in "
                                                          ]
                                                        },
                                                        {
                                                          "r": "140",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Psychiatric/Mental Health Diagnosis\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n    )"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "145",
                  "locator": "68:3-72:5",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "131",
                      "locator": "68:3-68:41",
                      "alias": "EDVisit",
                      "expression": {
                        "localId": "130",
                        "locator": "68:3-68:33",
                        "name": "Emergency Department ED Visit",
                        "type": "ExpressionRef"
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "144",
                    "locator": "69:5-72:5",
                    "type": "Exists",
                    "operand": {
                      "localId": "143",
                      "locator": "69:18-72:5",
                      "type": "Query",
                      "source": [
                        {
                          "localId": "133",
                          "locator": "69:20-69:41",
                          "alias": "Diag",
                          "expression": {
                            "localId": "132",
                            "locator": "69:20-69:36",
                            "path": "diagnoses",
                            "scope": "EDVisit",
                            "type": "Property"
                          }
                        }
                      ],
                      "relationship": [

                      ],
                      "where": {
                        "localId": "142",
                        "locator": "70:9-71:64",
                        "type": "And",
                        "operand": [
                          {
                            "localId": "137",
                            "locator": "70:15-70:27",
                            "type": "Equal",
                            "operand": [
                              {
                                "localId": "135",
                                "locator": "70:15-70:23",
                                "path": "rank",
                                "scope": "Diag",
                                "type": "Property"
                              },
                              {
                                "localId": "136",
                                "locator": "70:27",
                                "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                                "value": "1",
                                "type": "Literal"
                              }
                            ]
                          },
                          {
                            "localId": "141",
                            "locator": "71:15-71:64",
                            "type": "InValueSet",
                            "code": {
                              "localId": "139",
                              "locator": "71:15-71:23",
                              "path": "code",
                              "scope": "Diag",
                              "type": "Property"
                            },
                            "valueset": {
                              "localId": "140",
                              "locator": "71:28-71:64",
                              "name": "Psychiatric/Mental Health Diagnosis"
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              },
              {
                "localId": "162",
                "locator": "107:1-111:3",
                "name": "GetPrincipalDiagnosisCode",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "162",
                      "s": [
                        {
                          "value": [
                            "define function ",
                            "\"GetPrincipalDiagnosisCode\"",
                            "(",
                            "Enc",
                            " "
                          ]
                        },
                        {
                          "r": "150",
                          "s": [
                            {
                              "value": [
                                "\"Encounter, Performed\""
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "161",
                          "s": [
                            {
                              "r": "161",
                              "s": [
                                {
                                  "value": [
                                    "singleton from "
                                  ]
                                },
                                {
                                  "r": "160",
                                  "s": [
                                    {
                                      "value": [
                                        "( "
                                      ]
                                    },
                                    {
                                      "r": "160",
                                      "s": [
                                        {
                                          "s": [
                                            {
                                              "r": "152",
                                              "s": [
                                                {
                                                  "r": "151",
                                                  "s": [
                                                    {
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Enc",
                                                            ".",
                                                            "diagnoses"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " ",
                                                    "Diag"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n      "
                                          ]
                                        },
                                        {
                                          "r": "156",
                                          "s": [
                                            {
                                              "value": [
                                                "where "
                                              ]
                                            },
                                            {
                                              "r": "156",
                                              "s": [
                                                {
                                                  "r": "154",
                                                  "s": [
                                                    {
                                                      "r": "153",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "Diag"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "154",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "rank"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "r": "155",
                                                  "value": [
                                                    " ",
                                                    "=",
                                                    " ",
                                                    "1"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n      "
                                          ]
                                        },
                                        {
                                          "r": "159",
                                          "s": [
                                            {
                                              "value": [
                                                "return "
                                              ]
                                            },
                                            {
                                              "r": "158",
                                              "s": [
                                                {
                                                  "r": "157",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "Diag"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "."
                                                  ]
                                                },
                                                {
                                                  "r": "158",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "code"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n  )"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "161",
                  "locator": "108:3-111:3",
                  "type": "SingletonFrom",
                  "operand": {
                    "localId": "160",
                    "locator": "108:18-111:3",
                    "type": "Query",
                    "source": [
                      {
                        "localId": "152",
                        "locator": "108:20-108:37",
                        "alias": "Diag",
                        "expression": {
                          "localId": "151",
                          "locator": "108:20-108:32",
                          "path": "diagnoses",
                          "type": "Property",
                          "source": {
                            "name": "Enc",
                            "type": "OperandRef"
                          }
                        }
                      }
                    ],
                    "relationship": [

                    ],
                    "where": {
                      "localId": "156",
                      "locator": "109:7-109:25",
                      "type": "Equal",
                      "operand": [
                        {
                          "localId": "154",
                          "locator": "109:13-109:21",
                          "path": "rank",
                          "scope": "Diag",
                          "type": "Property"
                        },
                        {
                          "localId": "155",
                          "locator": "109:25",
                          "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                          "value": "1",
                          "type": "Literal"
                        }
                      ]
                    },
                    "return": {
                      "localId": "159",
                      "locator": "110:7-110:22",
                      "expression": {
                        "localId": "158",
                        "locator": "110:14-110:22",
                        "path": "code",
                        "scope": "Diag",
                        "type": "Property"
                      }
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Enc",
                    "operandTypeSpecifier": {
                      "localId": "150",
                      "locator": "107:49-107:70",
                      "name": "{urn:healthit-gov:qdm:v5_5}PositiveEncounterPerformed",
                      "type": "NamedTypeSpecifier"
                    }
                  }
                ]
              },
              {
                "localId": "179",
                "locator": "74:1-80:84",
                "name": "Strat3",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "179",
                      "s": [
                        {
                          "value": [
                            "define ",
                            "\"Strat3\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "178",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "148",
                                  "s": [
                                    {
                                      "r": "147",
                                      "s": [
                                        {
                                          "s": [
                                            {
                                              "value": [
                                                "\"Emergency Department ED Visit\""
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "EDVisit"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "s": [
                                {
                                  "value": [
                                    "let "
                                  ]
                                },
                                {
                                  "r": "164",
                                  "s": [
                                    {
                                      "value": [
                                        "DiagCode",
                                        ": "
                                      ]
                                    },
                                    {
                                      "r": "163",
                                      "s": [
                                        {
                                          "value": [
                                            "GetPrincipalDiagnosisCode",
                                            "("
                                          ]
                                        },
                                        {
                                          "r": "149",
                                          "s": [
                                            {
                                              "value": [
                                                "EDVisit"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            ")"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "177",
                              "s": [
                                {
                                  "value": [
                                    "where "
                                  ]
                                },
                                {
                                  "r": "177",
                                  "s": [
                                    {
                                      "r": "171",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "171",
                                          "s": [
                                            {
                                              "r": "166",
                                              "s": [
                                                {
                                                  "r": "165",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "DiagCode"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " is null"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n        or "
                                              ]
                                            },
                                            {
                                              "r": "170",
                                              "s": [
                                                {
                                                  "value": [
                                                    "not "
                                                  ]
                                                },
                                                {
                                                  "r": "169",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "( "
                                                      ]
                                                    },
                                                    {
                                                      "r": "169",
                                                      "s": [
                                                        {
                                                          "r": "167",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "DiagCode"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            " in "
                                                          ]
                                                        },
                                                        {
                                                          "r": "168",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Psychiatric/Mental Health Diagnosis\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        " )"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n    )"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      and "
                                      ]
                                    },
                                    {
                                      "r": "176",
                                      "s": [
                                        {
                                          "value": [
                                            "not "
                                          ]
                                        },
                                        {
                                          "r": "175",
                                          "s": [
                                            {
                                              "value": [
                                                "( "
                                              ]
                                            },
                                            {
                                              "r": "175",
                                              "s": [
                                                {
                                                  "r": "173",
                                                  "s": [
                                                    {
                                                      "r": "172",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "EDVisit"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "."
                                                      ]
                                                    },
                                                    {
                                                      "r": "173",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "dischargeDisposition"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    " in "
                                                  ]
                                                },
                                                {
                                                  "r": "174",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Discharge To Acute Care Facility\""
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " )"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "178",
                  "locator": "75:3-80:84",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "148",
                      "locator": "75:3-75:41",
                      "alias": "EDVisit",
                      "expression": {
                        "localId": "147",
                        "locator": "75:3-75:33",
                        "name": "Emergency Department ED Visit",
                        "type": "ExpressionRef"
                      }
                    }
                  ],
                  "let": [
                    {
                      "localId": "164",
                      "locator": "76:9-76:52",
                      "identifier": "DiagCode",
                      "expression": {
                        "localId": "163",
                        "locator": "76:19-76:52",
                        "name": "GetPrincipalDiagnosisCode",
                        "type": "FunctionRef",
                        "operand": [
                          {
                            "localId": "149",
                            "locator": "76:45-76:51",
                            "name": "EDVisit",
                            "type": "AliasRef"
                          }
                        ]
                      }
                    }
                  ],
                  "relationship": [

                  ],
                  "where": {
                    "localId": "177",
                    "locator": "77:5-80:84",
                    "type": "And",
                    "operand": [
                      {
                        "localId": "171",
                        "locator": "77:11-79:5",
                        "type": "Or",
                        "operand": [
                          {
                            "localId": "166",
                            "locator": "77:13-77:28",
                            "type": "IsNull",
                            "operand": {
                              "localId": "165",
                              "locator": "77:13-77:20",
                              "name": "DiagCode",
                              "type": "QueryLetRef"
                            }
                          },
                          {
                            "localId": "170",
                            "locator": "78:12-78:68",
                            "type": "Not",
                            "operand": {
                              "localId": "169",
                              "locator": "78:16-78:68",
                              "type": "InValueSet",
                              "code": {
                                "localId": "167",
                                "locator": "78:18-78:25",
                                "name": "DiagCode",
                                "type": "QueryLetRef"
                              },
                              "valueset": {
                                "localId": "168",
                                "locator": "78:30-78:66",
                                "name": "Psychiatric/Mental Health Diagnosis"
                              }
                            }
                          }
                        ]
                      },
                      {
                        "localId": "176",
                        "locator": "80:11-80:84",
                        "type": "Not",
                        "operand": {
                          "localId": "175",
                          "locator": "80:15-80:84",
                          "type": "InValueSet",
                          "code": {
                            "localId": "173",
                            "locator": "80:17-80:44",
                            "path": "dischargeDisposition",
                            "scope": "EDVisit",
                            "type": "Property"
                          },
                          "valueset": {
                            "localId": "174",
                            "locator": "80:49-80:82",
                            "name": "Discharge To Acute Care Facility"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "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": "17"
                  }
                ],
                "ref_id": "18"
              }
            ],
            "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": "19"
                  }
                ],
                "ref_id": "20"
              }
            ],
            "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": "21"
                  }
                ],
                "ref_id": "22"
              }
            ],
            "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": "23"
                  }
                ],
                "ref_id": "24"
              }
            ],
            "define_name": "SDE Sex"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Emergency Department ED Visit\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "[\"Encounter, Performed\": "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Emergency Department Visit\""
                                              }
                                            ]
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "]"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Retrieve",
                                    "ref_id": "25"
                                  }
                                ],
                                "node_type": "Retrieve",
                                "ref_id": "25"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EDVisit"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "26"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "27"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "."
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "relevantPeriod"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "28"
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "28"
                              },
                              {
                                "children": [
                                  {
                                    "text": " during "
                                  }
                                ],
                                "ref_id": "30"
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "\"Measurement Period\""
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ParameterRef",
                                "ref_id": "29"
                              }
                            ],
                            "ref_id": "30"
                          }
                        ],
                        "ref_id": "30"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "31"
                  }
                ],
                "ref_id": "32"
              }
            ],
            "define_name": "Emergency Department ED Visit"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Strat2\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"Emergency Department ED Visit\""
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ExpressionRef",
                                "ref_id": "33"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EDVisit"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "34"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "35"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "."
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "dischargeDisposition"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "36"
                                  }
                                ],
                                "ref_id": "36"
                              },
                              {
                                "children": [
                                  {
                                    "text": " in "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "\"Discharge To Acute Care Facility\""
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "37"
                              }
                            ],
                            "ref_id": "38"
                          }
                        ],
                        "ref_id": "38"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "39"
                  }
                ],
                "ref_id": "40"
              }
            ],
            "define_name": "Strat2"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Initial Population\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "[\"Encounter, Performed\": "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Emergency Department Visit\""
                                              }
                                            ]
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "]"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Retrieve",
                                    "ref_id": "41"
                                  }
                                ],
                                "node_type": "Retrieve",
                                "ref_id": "41"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EDVisit"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "42"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "43"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "."
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "relevantPeriod"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "44"
                                  }
                                ],
                                "node_type": "Property",
                                "ref_id": "44"
                              },
                              {
                                "children": [
                                  {
                                    "text": " during "
                                  }
                                ],
                                "ref_id": "46"
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "\"Measurement Period\""
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ParameterRef",
                                "ref_id": "45"
                              }
                            ],
                            "ref_id": "46"
                          }
                        ],
                        "ref_id": "46"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "47"
                  }
                ],
                "ref_id": "48"
              }
            ],
            "define_name": "Initial Population"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"ArrivalTime\"(Enc "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "56"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "First("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Enc.facilityLocations"
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "57"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " Location"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "58"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "return "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "start of "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Location"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "59"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "locationPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "60"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "60"
                                      }
                                    ],
                                    "node_type": "Start",
                                    "ref_id": "61"
                                  }
                                ],
                                "ref_id": "62"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      sort ascending"
                                  }
                                ],
                                "ref_id": "63"
                              }
                            ],
                            "ref_id": "64"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "First",
                        "ref_id": "65"
                      }
                    ],
                    "node_type": "First",
                    "ref_id": "65"
                  }
                ],
                "ref_id": "66"
              }
            ],
            "define_name": "ArrivalTime"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Observation Services Order\"(Enc "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "69"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "Last("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Encounter, Order\": "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Observation Services\""
                                                      }
                                                    ]
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "70"
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "70"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " ObservationOrder"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "71"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "where "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "ObservationOrder"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "72"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "authorDatetime"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "73"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "73"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " during "
                                          }
                                        ],
                                        "ref_id": "76"
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Enc"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "74"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "relevantPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "75"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "75"
                                      }
                                    ],
                                    "ref_id": "76"
                                  }
                                ],
                                "ref_id": "76"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "sort by "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "authorDatetime"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "77"
                                      }
                                    ],
                                    "ref_id": "78"
                                  }
                                ],
                                "ref_id": "79"
                              }
                            ],
                            "ref_id": "80"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Last",
                        "ref_id": "81"
                      }
                    ],
                    "node_type": "Last",
                    "ref_id": "81"
                  }
                ],
                "ref_id": "82"
              }
            ],
            "define_name": "Observation Services Order"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Departure Time\"(Enc "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "86"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "Last("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Enc.facilityLocations"
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "87"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " Location"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "88"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "return \n      "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "end of "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Location"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "89"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "locationPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "90"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "90"
                                      }
                                    ],
                                    "node_type": "End",
                                    "ref_id": "91"
                                  }
                                ],
                                "ref_id": "92"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      sort ascending"
                                  }
                                ],
                                "ref_id": "93"
                              }
                            ],
                            "ref_id": "94"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Last",
                        "ref_id": "95"
                      }
                    ],
                    "node_type": "Last",
                    "ref_id": "95"
                  }
                ],
                "ref_id": "96"
              }
            ],
            "define_name": "Departure Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Arrival to Observation Order or Departure Time\"(Enc "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "54"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "duration in minutes of "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "Interval["
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "\"ArrivalTime\"("
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "Enc"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "OperandRef",
                                    "ref_id": "55"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": ")"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "67"
                              },
                              {
                                "children": [
                                  {
                                    "text": ", "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "Coalesce("
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Observation Services Order\"("
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Enc"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "OperandRef",
                                            "ref_id": "68"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": ")"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "83"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "."
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "authorDatetime"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "84"
                                      }
                                    ],
                                    "node_type": "Property",
                                    "ref_id": "84"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": ", "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"Departure Time\"("
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "Enc"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "OperandRef",
                                        "ref_id": "85"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ")"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "FunctionRef",
                                    "ref_id": "97"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": ")"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "98"
                              },
                              {
                                "children": [
                                  {
                                    "text": "]"
                                  }
                                ]
                              }
                            ],
                            "node_type": "Interval",
                            "ref_id": "99"
                          }
                        ],
                        "node_type": "DurationBetween",
                        "ref_id": "100"
                      }
                    ],
                    "node_type": "DurationBetween",
                    "ref_id": "100"
                  }
                ],
                "ref_id": "101"
              }
            ],
            "define_name": "Arrival to Observation Order or Departure Time"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"Measure Observation\"(Enc "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "52"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "\"Arrival to Observation Order or Departure Time\"("
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "Enc"
                                  }
                                ]
                              }
                            ],
                            "node_type": "OperandRef",
                            "ref_id": "53"
                          },
                          {
                            "children": [
                              {
                                "text": ")"
                              }
                            ]
                          }
                        ],
                        "node_type": "FunctionRef",
                        "ref_id": "102"
                      }
                    ],
                    "node_type": "FunctionRef",
                    "ref_id": "102"
                  }
                ],
                "ref_id": "103"
              }
            ],
            "define_name": "Measure Observation"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Measure Population\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"Initial Population\""
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ExpressionRef",
                                "ref_id": "49"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EDVisit"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "50"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "\"Measure Observation\"("
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "AliasRef",
                                    "ref_id": "51"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": ")"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "FunctionRef",
                                "ref_id": "104"
                              },
                              {
                                "children": [
                                  {
                                    "text": "is not null"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "105"
                          }
                        ],
                        "ref_id": "105"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "106"
                  }
                ],
                "ref_id": "107"
              }
            ],
            "define_name": "Measure Population"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Measure Population Exclusions\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "( "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Emergency Department ED Visit\""
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "ExpressionRef",
                                        "ref_id": "108"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "109"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "where "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "EDVisit"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "110"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "dischargeDisposition"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "111"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "111"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " ~ "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Patient deceased during stay (discharge status = dead) (finding)\""
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "CodeRef",
                                        "ref_id": "112"
                                      }
                                    ],
                                    "ref_id": "113"
                                  }
                                ],
                                "ref_id": "113"
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "114"
                          },
                          {
                            "children": [
                              {
                                "text": "\n  )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "114"
                      },
                      {
                        "children": [
                          {
                            "text": "\n    union "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "( "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Emergency Department ED Visit\""
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "ExpressionRef",
                                        "ref_id": "115"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "116"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n        "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "with "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "[\"Encounter, Performed\": "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Encounter Inpatient\""
                                                      }
                                                    ]
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "]"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Retrieve",
                                            "ref_id": "117"
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "117"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " Encounter"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "118"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n          such that "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "EDVisit"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "119"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "relevantPeriod"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "120"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "120"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "ends "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "1 hour"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Quantity",
                                            "ref_id": "124"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " or less before or on"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "And",
                                        "ref_id": "125"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "start of "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Encounter"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "121"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "relevantPeriod"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "122"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "122"
                                          }
                                        ],
                                        "node_type": "Start",
                                        "ref_id": "123"
                                      }
                                    ],
                                    "node_type": "And",
                                    "ref_id": "125"
                                  }
                                ],
                                "ref_id": "126"
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "127"
                          },
                          {
                            "children": [
                              {
                                "text": "\n    )"
                              }
                            ]
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "127"
                      }
                    ],
                    "node_type": "Union",
                    "ref_id": "128"
                  }
                ],
                "ref_id": "129"
              }
            ],
            "define_name": "Measure Population Exclusions"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Strat1\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"Emergency Department ED Visit\""
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ExpressionRef",
                                "ref_id": "130"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EDVisit"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "131"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "exists "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "EDVisit.diagnoses"
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "132"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " Diag"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "133"
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "where "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "Diag"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "134"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "rank"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "135"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "135"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " = 1"
                                                      }
                                                    ],
                                                    "node_type": "Literal",
                                                    "ref_id": "136"
                                                  }
                                                ],
                                                "node_type": "Equal",
                                                "ref_id": "137"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n          and "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "Diag"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "138"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "code"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "139"
                                                      }
                                                    ],
                                                    "ref_id": "139"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " in "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Psychiatric/Mental Health Diagnosis\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "140"
                                                  }
                                                ],
                                                "node_type": "InValueSet",
                                                "ref_id": "141"
                                              }
                                            ],
                                            "ref_id": "142"
                                          }
                                        ],
                                        "ref_id": "142"
                                      }
                                    ],
                                    "node_type": "Query",
                                    "ref_id": "143"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n    )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Query",
                                "ref_id": "143"
                              }
                            ],
                            "ref_id": "144"
                          }
                        ],
                        "ref_id": "144"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "145"
                  }
                ],
                "ref_id": "146"
              }
            ],
            "define_name": "Strat1"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"GetPrincipalDiagnosisCode\"(Enc "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "\"Encounter, Performed\""
                          }
                        ]
                      }
                    ],
                    "ref_id": "150"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "singleton from "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "( "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Enc.diagnoses"
                                                      }
                                                    ]
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "151"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " Diag"
                                              }
                                            ]
                                          }
                                        ],
                                        "ref_id": "152"
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n      "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "where "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "Diag"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "153"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "rank"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "Property",
                                                "ref_id": "154"
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "154"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " = 1"
                                              }
                                            ],
                                            "node_type": "Literal",
                                            "ref_id": "155"
                                          }
                                        ],
                                        "ref_id": "156"
                                      }
                                    ],
                                    "ref_id": "156"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n      "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "return "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "Diag"
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "157"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "."
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "code"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "Property",
                                            "ref_id": "158"
                                          }
                                        ],
                                        "node_type": "Property",
                                        "ref_id": "158"
                                      }
                                    ],
                                    "ref_id": "159"
                                  }
                                ],
                                "node_type": "Query",
                                "ref_id": "160"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n  )"
                                  }
                                ]
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "160"
                          }
                        ],
                        "node_type": "SingletonFrom",
                        "ref_id": "161"
                      }
                    ],
                    "node_type": "SingletonFrom",
                    "ref_id": "161"
                  }
                ],
                "ref_id": "162"
              }
            ],
            "define_name": "GetPrincipalDiagnosisCode"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Strat3\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"Emergency Department ED Visit\""
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "ExpressionRef",
                                "ref_id": "147"
                              },
                              {
                                "children": [
                                  {
                                    "text": " EDVisit"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "148"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "let "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "DiagCode: "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "GetPrincipalDiagnosisCode("
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "EDVisit"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "AliasRef",
                                    "ref_id": "149"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": ")"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "FunctionRef",
                                "ref_id": "163"
                              }
                            ],
                            "ref_id": "164"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "where "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "DiagCode"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "QueryLetRef",
                                            "ref_id": "165"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " is null"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "IsNull",
                                        "ref_id": "166"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        or "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "not "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "( "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "DiagCode"
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "167"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " in "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Psychiatric/Mental Health Diagnosis\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "ref_id": "168"
                                                  }
                                                ],
                                                "node_type": "InValueSet",
                                                "ref_id": "169"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " )"
                                                  }
                                                ]
                                              }
                                            ],
                                            "node_type": "InValueSet",
                                            "ref_id": "169"
                                          }
                                        ],
                                        "node_type": "Not",
                                        "ref_id": "170"
                                      }
                                    ],
                                    "node_type": "Or",
                                    "ref_id": "171"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n    )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "Or",
                                "ref_id": "171"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      and "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "not "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "( "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "EDVisit"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "172"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "."
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "dischargeDisposition"
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "ref_id": "173"
                                              }
                                            ],
                                            "ref_id": "173"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": " in "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Discharge To Acute Care Facility\""
                                                  }
                                                ]
                                              }
                                            ],
                                            "ref_id": "174"
                                          }
                                        ],
                                        "node_type": "InValueSet",
                                        "ref_id": "175"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " )"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "InValueSet",
                                    "ref_id": "175"
                                  }
                                ],
                                "node_type": "Not",
                                "ref_id": "176"
                              }
                            ],
                            "ref_id": "177"
                          }
                        ],
                        "ref_id": "177"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "178"
                  }
                ],
                "ref_id": "179"
              }
            ],
            "define_name": "Strat3"
          }
        ],
        "identifier": {
          "id": "LikeCMS32",
          "version": "0.0.003"
        }
      },
      "is_main_library": true,
      "is_top_level": true,
      "library_name": "LikeCMS32",
      "library_version": "0.0.003",
      "statement_dependencies": [
        {
          "_id": "5d48728057a11e8a91275c13",
          "statement_name": "Patient"
        },
        {
          "_id": "5d48728057a11e8a91275c14",
          "statement_name": "SDE Ethnicity"
        },
        {
          "_id": "5d48728057a11e8a91275c15",
          "statement_name": "SDE Payer"
        },
        {
          "_id": "5d48728057a11e8a91275c16",
          "statement_name": "SDE Race"
        },
        {
          "_id": "5d48728057a11e8a91275c17",
          "statement_name": "SDE Sex"
        },
        {
          "_id": "5d48728057a11e8a91275c18",
          "statement_name": "Emergency Department ED Visit"
        },
        {
          "_id": "5d48728057a11e8a91275c19",
          "statement_name": "Strat2",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c1a",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Emergency Department ED Visit"
            }
          ]
        },
        {
          "_id": "5d48728057a11e8a91275c1b",
          "statement_name": "Initial Population"
        },
        {
          "_id": "5d48728057a11e8a91275c1c",
          "statement_name": "ArrivalTime"
        },
        {
          "_id": "5d48728057a11e8a91275c1d",
          "statement_name": "Observation Services Order"
        },
        {
          "_id": "5d48728057a11e8a91275c1e",
          "statement_name": "Departure Time"
        },
        {
          "_id": "5d48728057a11e8a91275c1f",
          "statement_name": "Arrival to Observation Order or Departure Time",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c20",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "ArrivalTime"
            },
            {
              "_id": "5d48728057a11e8a91275c21",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Observation Services Order"
            },
            {
              "_id": "5d48728057a11e8a91275c22",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Departure Time"
            }
          ]
        },
        {
          "_id": "5d48728057a11e8a91275c23",
          "statement_name": "Measure Observation",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c24",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Arrival to Observation Order or Departure Time"
            }
          ]
        },
        {
          "_id": "5d48728057a11e8a91275c25",
          "statement_name": "Measure Population",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c26",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Initial Population"
            },
            {
              "_id": "5d48728057a11e8a91275c27",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Measure Observation"
            }
          ]
        },
        {
          "_id": "5d48728057a11e8a91275c28",
          "statement_name": "Measure Population Exclusions",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c29",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Emergency Department ED Visit"
            }
          ]
        },
        {
          "_id": "5d48728057a11e8a91275c2a",
          "statement_name": "Strat1",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c2b",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Emergency Department ED Visit"
            }
          ]
        },
        {
          "_id": "5d48728057a11e8a91275c2c",
          "statement_name": "GetPrincipalDiagnosisCode"
        },
        {
          "_id": "5d48728057a11e8a91275c2d",
          "statement_name": "Strat3",
          "statement_references": [
            {
              "_id": "5d48728057a11e8a91275c2e",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "Emergency Department ED Visit"
            },
            {
              "_id": "5d48728057a11e8a91275c2f",
              "hqmf_id": null,
              "library_name": "LikeCMS32",
              "statement_name": "GetPrincipalDiagnosisCode"
            }
          ]
        }
      ]
    }
  ],
  "created_at": "2019-08-05T18:16:32.810Z",
  "description": "Testing Bonnie's ability to process CV measures",
  "hqmf_id": "40280382667FECC30167190FAE723AAE",
  "hqmf_set_id": "4DC3E7AA-8777-4749-A1E4-37E942036076",
  "hqmf_version_number": "0.0.003",
  "main_cql_library": "LikeCMS32",
  "measure_attributes": [
    {
      "code": "OTH",
      "value": "903",
      "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": "903",
        "media_type": "text/plain"
      }
    },
    {
      "code": "OTH",
      "value": "Not Applicable",
      "name": "NQF Number",
      "code_obj": {
        "type": "CD",
        "null_flavor": "OTH",
        "original_text": "NQF Number"
      },
      "value_obj": {
        "type": "ED",
        "value": "Not Applicable",
        "media_type": "text/plain"
      }
    },
    {
      "code": "COPY",
      "value": "",
      "name": "Copyright",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "COPY",
        "title": "Copyright"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "DISC",
      "value": "",
      "name": "Disclaimer",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "DISC",
        "title": "Disclaimer"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "MSRSCORE",
      "name": "Measure Scoring",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "MSRSCORE",
        "title": "Measure Scoring"
      },
      "value_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.1063",
        "code": "CONTVAR",
        "title": "Continuous Variable"
      }
    },
    {
      "code": "STRAT",
      "value": "",
      "name": "Stratification",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "STRAT",
        "title": "Stratification"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "MSRADJ",
      "value": "",
      "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": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "MSRAGG",
      "value": "",
      "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": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "RAT",
      "value": "",
      "name": "Rationale",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "RAT",
        "title": "Rationale"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "CRS",
      "value": "",
      "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": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "IDUR",
      "value": "<foo bar=\"smaller\">smaller-is-better</foo>",
      "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": "<foo bar=\"smaller\">smaller-is-better</foo>",
        "media_type": "text/plain"
      }
    },
    {
      "code": "REF",
      "name": "Reference",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "REF",
        "title": "Reference"
      },
      "value_obj": {
        "type": "ED",
        "media_type": "text/plain"
      }
    },
    {
      "code": "DEF",
      "name": "Definition",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "DEF",
        "title": "Definition"
      },
      "value_obj": {
        "type": "ED",
        "media_type": "text/plain"
      }
    },
    {
      "code": "GUIDE",
      "value": "",
      "name": "Guidance",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "GUIDE",
        "title": "Guidance"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "TRANF",
      "value": "",
      "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": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "IPOP",
      "value": "",
      "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": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "MSRPOPL",
      "value": "",
      "name": "Measure Population",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "MSRPOPL",
        "title": "Measure Population"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "MSRPOPLEX",
      "value": "",
      "name": "Measure Population Exclusions",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "MSRPOPLEX",
        "title": "Measure Population Exclusions"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "MSROBS",
      "value": "",
      "name": "Measure Observation",
      "code_obj": {
        "type": "CD",
        "system": "2.16.840.1.113883.5.4",
        "code": "MSROBS",
        "title": "Measure Observation"
      },
      "value_obj": {
        "type": "ED",
        "value": "",
        "media_type": "text/plain"
      }
    },
    {
      "code": "SDE",
      "value": "",
      "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": "",
        "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": "CONTINUOUS_VARIABLE",
  "patient_ids": [

  ],
  "population_criteria": {
    "OBSERV": {
      "conjunction?": false,
      "type": "OBSERV",
      "hqmf_id": "558EB897-E657-4A3F-945A-313775CE2C89",
      "aggregator": "MEDIAN"
    },
    "IPP": {
      "conjunction?": true,
      "type": "IPP",
      "hqmf_id": "D5234DDF-B2DF-4D0E-B822-C6C9A1ACB4B8",
      "preconditions": [
        {
          "id": 2,
          "preconditions": [
            {
              "id": 1,
              "reference": "LikeCMS32__Initial_Population__CF321C6C_BEE6_40F3_9570_10450556CAD1"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "MSRPOPL": {
      "conjunction?": true,
      "type": "MSRPOPL",
      "hqmf_id": "665465ED-0573-406B-9A3A-A47D77C4C6C6",
      "preconditions": [
        {
          "id": 4,
          "preconditions": [
            {
              "id": 3,
              "reference": "LikeCMS32__Measure_Population__CF321C6C_BEE6_40F3_9570_10450556CAD1"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "MSRPOPLEX": {
      "conjunction?": true,
      "type": "MSRPOPLEX",
      "hqmf_id": "CD78562F-E2C8-4792-A634-37A0DACC3E28",
      "preconditions": [
        {
          "id": 6,
          "preconditions": [
            {
              "id": 5,
              "reference": "LikeCMS32__Measure_Population_Exclusions__CF321C6C_BEE6_40F3_9570_10450556CAD1"
            }
          ],
          "conjunction_code": "atLeastOneTrue"
        }
      ]
    },
    "STRAT": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "429368C4-06ED-4729-A52E-BC5A56F3B0D7",
      "preconditions": [
        {
          "id": 10,
          "preconditions": [
            {
              "id": 9,
              "reference": "LikeCMS32__Strat1__CF321C6C_BEE6_40F3_9570_10450556CAD1"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "STRAT_1": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "F0BA095E-AD2E-4A05-A19F-A461835126B9",
      "preconditions": [
        {
          "id": 14,
          "preconditions": [
            {
              "id": 13,
              "reference": "LikeCMS32__Strat2__CF321C6C_BEE6_40F3_9570_10450556CAD1"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    },
    "STRAT_2": {
      "conjunction?": true,
      "type": "STRAT",
      "hqmf_id": "3B414F16-D957-4D5B-83A8-B49362FB2C69",
      "preconditions": [
        {
          "id": 18,
          "preconditions": [
            {
              "id": 17,
              "reference": "LikeCMS32__Strat3__CF321C6C_BEE6_40F3_9570_10450556CAD1"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    }
  },
  "population_sets": [
    {
      "_id": "5d48728057a11e8a91275c37",
      "observations": [
        {
          "_id": "5d48728057a11e8a91275c46",
          "aggregation_type": "MEDIAN",
          "hqmf_id": "558EB897-E657-4A3F-945A-313775CE2C89",
          "observation_function": {
            "_id": "5d48728057a11e8a91275c47",
            "hqmf_id": "558EB897-E657-4A3F-945A-313775CE2C89",
            "library_name": "LikeCMS32",
            "statement_name": "Measure Observation"
          },
          "observation_parameter": {
            "_id": "5d48728057a11e8a91275c48",
            "hqmf_id": "558EB897-E657-4A3F-945A-313775CE2C89",
            "library_name": "LikeCMS32",
            "statement_name": "Measure Population"
          }
        }
      ],
      "population_set_id": "PopulationSet_1",
      "populations": {
        "IPP": {
          "_id": "5d48728057a11e8a91275c39",
          "hqmf_id": "D5234DDF-B2DF-4D0E-B822-C6C9A1ACB4B8",
          "library_name": "LikeCMS32",
          "statement_name": "Initial Population"
        },
        "MSRPOPL": {
          "_id": "5d48728057a11e8a91275c3a",
          "hqmf_id": "665465ED-0573-406B-9A3A-A47D77C4C6C6",
          "library_name": "LikeCMS32",
          "statement_name": "Measure Population"
        },
        "MSRPOPLEX": {
          "_id": "5d48728057a11e8a91275c3b",
          "hqmf_id": "CD78562F-E2C8-4792-A634-37A0DACC3E28",
          "library_name": "LikeCMS32",
          "statement_name": "Measure Population Exclusions"
        },
        "_id": "5d48728057a11e8a91275c38",
        "_type": "CQM::ContinuousVariablePopulationMap"
      },
      "stratifications": [
        {
          "_id": "5d48728057a11e8a91275c3c",
          "hqmf_id": "429368C4-06ED-4729-A52E-BC5A56F3B0D7",
          "statement": {
            "_id": "5d48728057a11e8a91275c3d",
            "hqmf_id": "429368C4-06ED-4729-A52E-BC5A56F3B0D7",
            "library_name": "LikeCMS32",
            "statement_name": "Strat1"
          },
          "stratification_id": "PopulationSet_1_Stratification_1",
          "title": "PopSet1 Stratification 1"
        },
        {
          "_id": "5d48728057a11e8a91275c3e",
          "hqmf_id": "F0BA095E-AD2E-4A05-A19F-A461835126B9",
          "statement": {
            "_id": "5d48728057a11e8a91275c3f",
            "hqmf_id": "F0BA095E-AD2E-4A05-A19F-A461835126B9",
            "library_name": "LikeCMS32",
            "statement_name": "Strat2"
          },
          "stratification_id": "PopulationSet_1_Stratification_2",
          "title": "PopSet1 Stratification 2"
        },
        {
          "_id": "5d48728057a11e8a91275c40",
          "hqmf_id": "3B414F16-D957-4D5B-83A8-B49362FB2C69",
          "statement": {
            "_id": "5d48728057a11e8a91275c41",
            "hqmf_id": "3B414F16-D957-4D5B-83A8-B49362FB2C69",
            "library_name": "LikeCMS32",
            "statement_name": "Strat3"
          },
          "stratification_id": "PopulationSet_1_Stratification_3",
          "title": "PopSet1 Stratification 3"
        }
      ],
      "supplemental_data_elements": [
        {
          "_id": "5d48728057a11e8a91275c42",
          "hqmf_id": "036572F4-6266-4AB2-805D-40E39F946958",
          "library_name": "LikeCMS32",
          "statement_name": "SDE Ethnicity"
        },
        {
          "_id": "5d48728057a11e8a91275c43",
          "hqmf_id": "0B26AB75-BD8F-42C7-9BD3-F1A1450C8A50",
          "library_name": "LikeCMS32",
          "statement_name": "SDE Payer"
        },
        {
          "_id": "5d48728057a11e8a91275c44",
          "hqmf_id": "AFF35AAE-7E41-42A2-8812-8E01747C20C2",
          "library_name": "LikeCMS32",
          "statement_name": "SDE Race"
        },
        {
          "_id": "5d48728057a11e8a91275c45",
          "hqmf_id": "39B95513-56D2-40D5-AD3B-FD9938F8728D",
          "library_name": "LikeCMS32",
          "statement_name": "SDE Sex"
        }
      ],
      "title": "Population Criteria Section"
    }
  ],
  "source_data_criteria": [
    {
      "_id": "5d48728057a11e8a91275c30",
      "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": "5d48728057a11e8a91275c30",
      "lengthOfStay": null,
      "negationRationale": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    },
    {
      "_id": "5d48728057a11e8a91275c31",
      "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": "5d48728057a11e8a91275c31",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "payer",
      "qdmTitle": "Patient Characteristic Payer",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::PatientCharacteristicPayer"
    },
    {
      "_id": "5d48728057a11e8a91275c32",
      "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": "5d48728057a11e8a91275c32",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "gender",
      "qdmTitle": "Patient Characteristic Sex",
      "qdmVersion": "5.5",
      "_type": "QDM::PatientCharacteristicSex"
    },
    {
      "_id": "5d48728057a11e8a91275c33",
      "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": "5d48728057a11e8a91275c33",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "ethnicity",
      "qdmTitle": "Patient Characteristic Ethnicity",
      "qdmVersion": "5.5",
      "_type": "QDM::PatientCharacteristicEthnicity"
    },
    {
      "_id": "5d48728057a11e8a91275c34",
      "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": "5d48728057a11e8a91275c34",
      "qdmCategory": "patient_characteristic",
      "qdmStatus": "race",
      "qdmTitle": "Patient Characteristic Race",
      "qdmVersion": "5.5",
      "_type": "QDM::PatientCharacteristicRace"
    },
    {
      "_id": "5d48728057a11e8a91275c35",
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113762.1.4.1111.143",
      "dataElementCodes": [

      ],
      "description": "Encounter, Order: ObservationServices",
      "facilityLocation": null,
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.27",
      "id": "5d48728057a11e8a91275c35",
      "negationRationale": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "order",
      "qdmTitle": "Encounter, Order",
      "qdmVersion": "5.5",
      "reason": null,
      "_type": "QDM::EncounterOrder"
    },
    {
      "_id": "5d48728057a11e8a91275c36",
      "admissionSource": null,
      "authorDatetime": null,
      "codeListId": "2.16.840.1.113883.3.117.1.7.1.292",
      "dataElementCodes": [

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

      ],
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.5",
      "id": "5d48728057a11e8a91275c36",
      "lengthOfStay": null,
      "negationRationale": null,
      "priority": null,
      "qdmCategory": "encounter",
      "qdmStatus": "performed",
      "qdmTitle": "Encounter, Performed",
      "qdmVersion": "5.5",
      "relevantPeriod": null,
      "_type": "QDM::EncounterPerformed"
    }
  ],
  "title": "LikeCMS32",
  "updated_at": "2019-08-05T18:16:32.810Z",
  "user_id": "501fdba3044a111b98000001",
  "value_set_ids": [
    "5d48727f57a11e8a91275c06",
    "5d48728057a11e8a91275c07",
    "5d48728057a11e8a91275c08",
    "5d48728057a11e8a91275c09",
    "5d48728057a11e8a91275c0a",
    "5d48728057a11e8a91275c0b",
    "5d48728057a11e8a91275c0c",
    "5d48728057a11e8a91275c0d",
    "5d48728057a11e8a91275c0e",
    "5d48728057a11e8a91275c0f"
  ]
}