{
  "composite": false,
  "component": false,
  "component_hqmf_set_ids": [],
  "measure_scoring": "COHORT",
  "calculation_method": "EPISODE_OF_CARE",
  "source_data_criteria": [
    {
      "dataElementCodes": [],
      "_id": "65c4ea736068b11663b74824",
      "prescriber": [],
      "relatedTo": [],
      "qdmTitle": "Medication, Order",
      "hqmfOid": "2.16.840.1.113883.10.20.28.4.51",
      "qdmCategory": "medication",
      "qdmStatus": "order",
      "qdmVersion": "5.6",
      "_type": "QDM::MedicationOrder",
      "description": "Medication, Order: DigoxinMedications",
      "codeListId": "2.16.840.1.113883.3.464.1003.1065",
      "id": "65c4ea736068b11663b74824"
    }
  ],
  "measure_attributes": [],
  "patients": [],
  "value_sets": [
    "65c4ea736068b11663b7481a"
  ],
  "_id": "65c4ea736068b11663b7481c",
  "title": "TestWhenCase",
  "description": "",
  "hqmf_id": "8A6D0413-8D31-A32C-018D-60D0A6600AD3",
  "hqmf_set_id": "25B51662-1A12-411E-AC9D-22657E11EED8",
  "main_cql_library": "TestWhenCase",
  "hqmf_version_number": "0.0.008",
  "cms_id": "CMSv0",
  "calculate_sdes": null,
  "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
    }
  },
  "population_criteria": {
    "IPP": {
      "conjunction?": true,
      "type": "IPP",
      "hqmf_id": "8507F30A-36AB-4B77-9C71-EB6BF7ECCD30",
      "preconditions": [
        {
          "id": 2,
          "preconditions": [
            {
              "id": 1,
              "reference": "TestWhenCase__Initial_Population__1665C489_6C17_4F50_9F37_C23DBB7E5434"
            }
          ],
          "conjunction_code": "allTrue"
        }
      ]
    }
  },
  "updated_at": 1707403891552,
  "created_at": 1707403891552,
  "cql_libraries": [
    {
      "is_main_library": true,
      "is_top_level": true,
      "_id": "65c4ea736068b11663b7481d",
      "library_name": "TestWhenCase",
      "library_version": "0.0.008",
      "elm": {
        "library": {
          "annotation": [
            {
              "translatorOptions": "EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion,DisableMethodInvocation",
              "type": "CqlToElmInfo"
            },
            {
              "type": "Annotation",
              "s": {
                "r": "112",
                "s": [
                  {
                    "value": [
                      "",
                      "library TestWhenCase version '0.0.008'"
                    ]
                  }
                ]
              }
            }
          ],
          "identifier": {
            "id": "TestWhenCase",
            "version": "0.0.008"
          },
          "schemaIdentifier": {
            "id": "urn:hl7-org:elm",
            "version": "r1"
          },
          "usings": {
            "def": [
              {
                "localIdentifier": "System",
                "uri": "urn:hl7-org:elm-types:r1"
              },
              {
                "localId": "1",
                "locator": "3:1-3:23",
                "localIdentifier": "QDM",
                "uri": "urn:healthit-gov:qdm:v5_6",
                "version": "5.6",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "1",
                      "s": [
                        {
                          "value": [
                            "",
                            "using "
                          ]
                        },
                        {
                          "s": [
                            {
                              "value": [
                                "QDM"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " version ",
                            "'5.6'"
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          },
          "parameters": {
            "def": [
              {
                "localId": "5",
                "locator": "7:1-7:49",
                "name": "Measurement Period",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "5",
                      "s": [
                        {
                          "value": [
                            "",
                            "parameter ",
                            "\"Measurement Period\"",
                            " "
                          ]
                        },
                        {
                          "r": "4",
                          "s": [
                            {
                              "value": [
                                "Interval<"
                              ]
                            },
                            {
                              "r": "3",
                              "s": [
                                {
                                  "value": [
                                    "DateTime"
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                ">"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "parameterTypeSpecifier": {
                  "localId": "4",
                  "locator": "7:32-7:49",
                  "type": "IntervalTypeSpecifier",
                  "pointType": {
                    "localId": "3",
                    "locator": "7:41-7:48",
                    "name": "{urn:hl7-org:elm-types:r1}DateTime",
                    "type": "NamedTypeSpecifier"
                  }
                }
              }
            ]
          },
          "valueSets": {
            "def": [
              {
                "localId": "2",
                "locator": "5:1-5:75",
                "name": "Digoxin Medications",
                "id": "2.16.840.1.113883.3.464.1003.1065",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "2",
                      "s": [
                        {
                          "value": [
                            "",
                            "valueset ",
                            "\"Digoxin Medications\"",
                            ": ",
                            "'urn:oid:2.16.840.1.113883.3.464.1003.1065'"
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          },
          "contexts": {
            "def": [
              {
                "locator": "9:1-9:15",
                "name": "Patient"
              }
            ]
          },
          "statements": {
            "def": [
              {
                "locator": "9:1-9:15",
                "name": "Patient",
                "context": "Patient",
                "expression": {
                  "type": "SingletonFrom",
                  "operand": {
                    "locator": "9:1-9:15",
                    "dataType": "{urn:healthit-gov:qdm:v5_6}Patient",
                    "templateId": "Patient",
                    "type": "Retrieve"
                  }
                }
              },
              {
                "localId": "81",
                "locator": "25:1-41:27",
                "name": "More Than One Order",
                "context": "Patient",
                "accessLevel": "Public",
                "type": "FunctionDef",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "81",
                      "s": [
                        {
                          "value": [
                            "",
                            "define function ",
                            "\"More Than One Order\"",
                            "(",
                            "Medication",
                            " "
                          ]
                        },
                        {
                          "r": "8",
                          "s": [
                            {
                              "value": [
                                "List<"
                              ]
                            },
                            {
                              "r": "7",
                              "s": [
                                {
                                  "value": [
                                    "\"Medication, Order\""
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                ">"
                              ]
                            }
                          ]
                        },
                        {
                          "value": [
                            " ):\n  "
                          ]
                        },
                        {
                          "r": "80",
                          "s": [
                            {
                              "r": "80",
                              "s": [
                                {
                                  "s": [
                                    {
                                      "r": "10",
                                      "s": [
                                        {
                                          "r": "9",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Medication\""
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "OrderMedication1"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n    "
                                  ]
                                },
                                {
                                  "r": "77",
                                  "s": [
                                    {
                                      "value": [
                                        "with "
                                      ]
                                    },
                                    {
                                      "r": "12",
                                      "s": [
                                        {
                                          "r": "11",
                                          "s": [
                                            {
                                              "s": [
                                                {
                                                  "value": [
                                                    "\"Medication\""
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " ",
                                            "OrderMedication2"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      such that "
                                      ]
                                    },
                                    {
                                      "r": "76",
                                      "s": [
                                        {
                                          "r": "40",
                                          "s": [
                                            {
                                              "r": "21",
                                              "s": [
                                                {
                                                  "value": [
                                                    "( "
                                                  ]
                                                },
                                                {
                                                  "r": "21",
                                                  "s": [
                                                    {
                                                      "r": "16",
                                                      "s": [
                                                        {
                                                          "r": "14",
                                                          "s": [
                                                            {
                                                              "r": "13",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "OrderMedication1"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "14",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "authorDatetime"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "16",
                                                          "value": [
                                                            " ",
                                                            "during",
                                                            " "
                                                          ]
                                                        },
                                                        {
                                                          "r": "15",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Measurement Period\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n          and "
                                                      ]
                                                    },
                                                    {
                                                      "r": "20",
                                                      "s": [
                                                        {
                                                          "r": "18",
                                                          "s": [
                                                            {
                                                              "r": "17",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "OrderMedication1"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "18",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "refills"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "19",
                                                          "value": [
                                                            " ",
                                                            ">=",
                                                            " ",
                                                            "1"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n      )"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n        or "
                                              ]
                                            },
                                            {
                                              "r": "39",
                                              "s": [
                                                {
                                                  "value": [
                                                    "( "
                                                  ]
                                                },
                                                {
                                                  "r": "39",
                                                  "s": [
                                                    {
                                                      "r": "34",
                                                      "s": [
                                                        {
                                                          "r": "29",
                                                          "s": [
                                                            {
                                                              "r": "24",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "date from "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "23",
                                                                  "s": [
                                                                    {
                                                                      "r": "22",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "OrderMedication1"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "."
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "23",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "authorDatetime"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                " ",
                                                                "!~",
                                                                " "
                                                              ]
                                                            },
                                                            {
                                                              "r": "27",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "date from "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "26",
                                                                  "s": [
                                                                    {
                                                                      "r": "25",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "OrderMedication2"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "."
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "26",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "authorDatetime"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "\n            and "
                                                          ]
                                                        },
                                                        {
                                                          "r": "33",
                                                          "s": [
                                                            {
                                                              "r": "31",
                                                              "s": [
                                                                {
                                                                  "r": "30",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "OrderMedication1"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "."
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "31",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "authorDatetime"
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "r": "33",
                                                              "value": [
                                                                " ",
                                                                "during",
                                                                " "
                                                              ]
                                                            },
                                                            {
                                                              "r": "32",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "\"Measurement Period\""
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n            and "
                                                      ]
                                                    },
                                                    {
                                                      "r": "38",
                                                      "s": [
                                                        {
                                                          "r": "36",
                                                          "s": [
                                                            {
                                                              "r": "35",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "OrderMedication2"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "36",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "authorDatetime"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "38",
                                                          "value": [
                                                            " ",
                                                            "during",
                                                            " "
                                                          ]
                                                        },
                                                        {
                                                          "r": "37",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Measurement Period\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n        )"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            "\n        or "
                                          ]
                                        },
                                        {
                                          "r": "75",
                                          "s": [
                                            {
                                              "value": [
                                                "( "
                                              ]
                                            },
                                            {
                                              "r": "75",
                                              "s": [
                                                {
                                                  "r": "69",
                                                  "s": [
                                                    {
                                                      "r": "63",
                                                      "s": [
                                                        {
                                                          "r": "52",
                                                          "s": [
                                                            {
                                                              "r": "47",
                                                              "s": [
                                                                {
                                                                  "r": "43",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "date from "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "42",
                                                                      "s": [
                                                                        {
                                                                          "r": "41",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "OrderMedication1"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "42",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "authorDatetime"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    " ",
                                                                    "~",
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "46",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "date from "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "45",
                                                                      "s": [
                                                                        {
                                                                          "r": "44",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "OrderMedication2"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "45",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "authorDatetime"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "\n            and "
                                                              ]
                                                            },
                                                            {
                                                              "r": "51",
                                                              "s": [
                                                                {
                                                                  "r": "49",
                                                                  "s": [
                                                                    {
                                                                      "r": "48",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "OrderMedication1"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "value": [
                                                                        "."
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "49",
                                                                      "s": [
                                                                        {
                                                                          "value": [
                                                                            "authorDatetime"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "51",
                                                                  "value": [
                                                                    " ",
                                                                    "during",
                                                                    " "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "50",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "\"Measurement Period\""
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "value": [
                                                            "\n            and "
                                                          ]
                                                        },
                                                        {
                                                          "r": "62",
                                                          "s": [
                                                            {
                                                              "r": "56",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "date from "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "55",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "start of "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "54",
                                                                      "s": [
                                                                        {
                                                                          "r": "53",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "OrderMedication1"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "54",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "relevantPeriod"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                " ",
                                                                "!~",
                                                                " "
                                                              ]
                                                            },
                                                            {
                                                              "r": "60",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "date from "
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "59",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "start of "
                                                                      ]
                                                                    },
                                                                    {
                                                                      "r": "58",
                                                                      "s": [
                                                                        {
                                                                          "r": "57",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "OrderMedication2"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "value": [
                                                                            "."
                                                                          ]
                                                                        },
                                                                        {
                                                                          "r": "58",
                                                                          "s": [
                                                                            {
                                                                              "value": [
                                                                                "relevantPeriod"
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n            and "
                                                      ]
                                                    },
                                                    {
                                                      "r": "68",
                                                      "s": [
                                                        {
                                                          "r": "66",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "start of "
                                                              ]
                                                            },
                                                            {
                                                              "r": "65",
                                                              "s": [
                                                                {
                                                                  "r": "64",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "OrderMedication1"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "."
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "65",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "relevantPeriod"
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "68",
                                                          "value": [
                                                            " ",
                                                            "during",
                                                            " "
                                                          ]
                                                        },
                                                        {
                                                          "r": "67",
                                                          "s": [
                                                            {
                                                              "value": [
                                                                "\"Measurement Period\""
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n            and "
                                                  ]
                                                },
                                                {
                                                  "r": "74",
                                                  "s": [
                                                    {
                                                      "r": "72",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "start of "
                                                          ]
                                                        },
                                                        {
                                                          "r": "71",
                                                          "s": [
                                                            {
                                                              "r": "70",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "OrderMedication2"
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "value": [
                                                                "."
                                                              ]
                                                            },
                                                            {
                                                              "r": "71",
                                                              "s": [
                                                                {
                                                                  "value": [
                                                                    "relevantPeriod"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "r": "74",
                                                      "value": [
                                                        " ",
                                                        "during",
                                                        " "
                                                      ]
                                                    },
                                                    {
                                                      "r": "73",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "\"Measurement Period\""
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                "\n        )"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "value": [
                                    "\n    "
                                  ]
                                },
                                {
                                  "r": "79",
                                  "s": [
                                    {
                                      "value": [
                                        "return "
                                      ]
                                    },
                                    {
                                      "r": "78",
                                      "s": [
                                        {
                                          "value": [
                                            "OrderMedication1"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "80",
                  "locator": "26:3-41:27",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "10",
                      "locator": "26:3-26:31",
                      "alias": "OrderMedication1",
                      "expression": {
                        "localId": "9",
                        "locator": "26:3-26:14",
                        "name": "Medication",
                        "type": "OperandRef"
                      }
                    }
                  ],
                  "relationship": [
                    {
                      "localId": "77",
                      "locator": "27:5-40:9",
                      "alias": "OrderMedication2",
                      "type": "With",
                      "expression": {
                        "localId": "11",
                        "locator": "27:10-27:21",
                        "name": "Medication",
                        "type": "OperandRef"
                      },
                      "suchThat": {
                        "localId": "76",
                        "locator": "28:17-40:9",
                        "type": "Or",
                        "operand": [
                          {
                            "localId": "40",
                            "locator": "28:17-34:9",
                            "type": "Or",
                            "operand": [
                              {
                                "localId": "21",
                                "locator": "28:17-30:7",
                                "type": "And",
                                "operand": [
                                  {
                                    "localId": "16",
                                    "locator": "28:19-28:77",
                                    "type": "In",
                                    "operand": [
                                      {
                                        "localId": "14",
                                        "locator": "28:19-28:49",
                                        "path": "authorDatetime",
                                        "scope": "OrderMedication1",
                                        "type": "Property"
                                      },
                                      {
                                        "localId": "15",
                                        "locator": "28:58-28:77",
                                        "name": "Measurement Period",
                                        "type": "ParameterRef"
                                      }
                                    ]
                                  },
                                  {
                                    "localId": "20",
                                    "locator": "29:15-29:43",
                                    "type": "GreaterOrEqual",
                                    "operand": [
                                      {
                                        "localId": "18",
                                        "locator": "29:15-29:38",
                                        "path": "refills",
                                        "scope": "OrderMedication1",
                                        "type": "Property"
                                      },
                                      {
                                        "localId": "19",
                                        "locator": "29:43",
                                        "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                                        "value": "1",
                                        "type": "Literal"
                                      }
                                    ]
                                  }
                                ]
                              },
                              {
                                "localId": "39",
                                "locator": "31:12-34:9",
                                "type": "And",
                                "operand": [
                                  {
                                    "localId": "34",
                                    "locator": "31:14-32:75",
                                    "type": "And",
                                    "operand": [
                                      {
                                        "localId": "29",
                                        "locator": "31:14-31:99",
                                        "type": "Not",
                                        "operand": {
                                          "localId": "28",
                                          "locator": "31:14-31:99",
                                          "type": "Equivalent",
                                          "operand": [
                                            {
                                              "localId": "24",
                                              "locator": "31:14-31:54",
                                              "type": "DateFrom",
                                              "operand": {
                                                "localId": "23",
                                                "locator": "31:24-31:54",
                                                "path": "authorDatetime",
                                                "scope": "OrderMedication1",
                                                "type": "Property"
                                              }
                                            },
                                            {
                                              "localId": "27",
                                              "locator": "31:59-31:99",
                                              "type": "DateFrom",
                                              "operand": {
                                                "localId": "26",
                                                "locator": "31:69-31:99",
                                                "path": "authorDatetime",
                                                "scope": "OrderMedication2",
                                                "type": "Property"
                                              }
                                            }
                                          ]
                                        }
                                      },
                                      {
                                        "localId": "33",
                                        "locator": "32:17-32:75",
                                        "type": "In",
                                        "operand": [
                                          {
                                            "localId": "31",
                                            "locator": "32:17-32:47",
                                            "path": "authorDatetime",
                                            "scope": "OrderMedication1",
                                            "type": "Property"
                                          },
                                          {
                                            "localId": "32",
                                            "locator": "32:56-32:75",
                                            "name": "Measurement Period",
                                            "type": "ParameterRef"
                                          }
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "localId": "38",
                                    "locator": "33:17-33:75",
                                    "type": "In",
                                    "operand": [
                                      {
                                        "localId": "36",
                                        "locator": "33:17-33:47",
                                        "path": "authorDatetime",
                                        "scope": "OrderMedication2",
                                        "type": "Property"
                                      },
                                      {
                                        "localId": "37",
                                        "locator": "33:56-33:75",
                                        "name": "Measurement Period",
                                        "type": "ParameterRef"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "localId": "75",
                            "locator": "35:12-40:9",
                            "type": "And",
                            "operand": [
                              {
                                "localId": "69",
                                "locator": "35:14-38:84",
                                "type": "And",
                                "operand": [
                                  {
                                    "localId": "63",
                                    "locator": "35:14-37:120",
                                    "type": "And",
                                    "operand": [
                                      {
                                        "localId": "52",
                                        "locator": "35:14-36:75",
                                        "type": "And",
                                        "operand": [
                                          {
                                            "localId": "47",
                                            "locator": "35:14-35:98",
                                            "type": "Equivalent",
                                            "operand": [
                                              {
                                                "localId": "43",
                                                "locator": "35:14-35:54",
                                                "type": "DateFrom",
                                                "operand": {
                                                  "localId": "42",
                                                  "locator": "35:24-35:54",
                                                  "path": "authorDatetime",
                                                  "scope": "OrderMedication1",
                                                  "type": "Property"
                                                }
                                              },
                                              {
                                                "localId": "46",
                                                "locator": "35:58-35:98",
                                                "type": "DateFrom",
                                                "operand": {
                                                  "localId": "45",
                                                  "locator": "35:68-35:98",
                                                  "path": "authorDatetime",
                                                  "scope": "OrderMedication2",
                                                  "type": "Property"
                                                }
                                              }
                                            ]
                                          },
                                          {
                                            "localId": "51",
                                            "locator": "36:17-36:75",
                                            "type": "In",
                                            "operand": [
                                              {
                                                "localId": "49",
                                                "locator": "36:17-36:47",
                                                "path": "authorDatetime",
                                                "scope": "OrderMedication1",
                                                "type": "Property"
                                              },
                                              {
                                                "localId": "50",
                                                "locator": "36:56-36:75",
                                                "name": "Measurement Period",
                                                "type": "ParameterRef"
                                              }
                                            ]
                                          }
                                        ]
                                      },
                                      {
                                        "localId": "62",
                                        "locator": "37:17-37:120",
                                        "type": "Not",
                                        "operand": {
                                          "localId": "61",
                                          "locator": "37:17-37:120",
                                          "type": "Equivalent",
                                          "operand": [
                                            {
                                              "localId": "56",
                                              "locator": "37:17-37:66",
                                              "type": "DateFrom",
                                              "operand": {
                                                "localId": "55",
                                                "locator": "37:27-37:66",
                                                "type": "Start",
                                                "operand": {
                                                  "localId": "54",
                                                  "locator": "37:36-37:66",
                                                  "path": "relevantPeriod",
                                                  "scope": "OrderMedication1",
                                                  "type": "Property"
                                                }
                                              }
                                            },
                                            {
                                              "localId": "60",
                                              "locator": "37:71-37:120",
                                              "type": "DateFrom",
                                              "operand": {
                                                "localId": "59",
                                                "locator": "37:81-37:120",
                                                "type": "Start",
                                                "operand": {
                                                  "localId": "58",
                                                  "locator": "37:90-37:120",
                                                  "path": "relevantPeriod",
                                                  "scope": "OrderMedication2",
                                                  "type": "Property"
                                                }
                                              }
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  },
                                  {
                                    "localId": "68",
                                    "locator": "38:17-38:84",
                                    "type": "In",
                                    "operand": [
                                      {
                                        "localId": "66",
                                        "locator": "38:17-38:56",
                                        "type": "Start",
                                        "operand": {
                                          "localId": "65",
                                          "locator": "38:26-38:56",
                                          "path": "relevantPeriod",
                                          "scope": "OrderMedication1",
                                          "type": "Property"
                                        }
                                      },
                                      {
                                        "localId": "67",
                                        "locator": "38:65-38:84",
                                        "name": "Measurement Period",
                                        "type": "ParameterRef"
                                      }
                                    ]
                                  }
                                ]
                              },
                              {
                                "localId": "74",
                                "locator": "39:17-39:84",
                                "type": "In",
                                "operand": [
                                  {
                                    "localId": "72",
                                    "locator": "39:17-39:56",
                                    "type": "Start",
                                    "operand": {
                                      "localId": "71",
                                      "locator": "39:26-39:56",
                                      "path": "relevantPeriod",
                                      "scope": "OrderMedication2",
                                      "type": "Property"
                                    }
                                  },
                                  {
                                    "localId": "73",
                                    "locator": "39:65-39:84",
                                    "name": "Measurement Period",
                                    "type": "ParameterRef"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ],
                  "return": {
                    "localId": "79",
                    "locator": "41:5-41:27",
                    "expression": {
                      "localId": "78",
                      "locator": "41:12-41:27",
                      "name": "OrderMedication1",
                      "type": "AliasRef"
                    }
                  }
                },
                "operand": [
                  {
                    "name": "Medication",
                    "operandTypeSpecifier": {
                      "localId": "8",
                      "locator": "25:50-25:74",
                      "type": "ListTypeSpecifier",
                      "elementType": {
                        "localId": "7",
                        "locator": "25:55-25:73",
                        "name": "{urn:healthit-gov:qdm:v5_6}PositiveMedicationOrder",
                        "type": "NamedTypeSpecifier"
                      }
                    }
                  }
                ]
              },
              {
                "localId": "106",
                "locator": "14:1-23:31",
                "name": "test when then case",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "106",
                      "s": [
                        {
                          "value": [
                            "",
                            "define ",
                            "\"test when then case\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "105",
                          "s": [
                            {
                              "s": [
                                {
                                  "r": "83",
                                  "s": [
                                    {
                                      "r": "82",
                                      "s": [
                                        {
                                          "value": [
                                            "( "
                                          ]
                                        },
                                        {
                                          "r": "82",
                                          "s": [
                                            {
                                              "value": [
                                                "\"More Than One Order\"",
                                                "("
                                              ]
                                            },
                                            {
                                              "r": "6",
                                              "s": [
                                                {
                                                  "value": [
                                                    "[",
                                                    "\"Medication, Order\"",
                                                    ": "
                                                  ]
                                                },
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "\"Digoxin Medications\""
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "]"
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                ")"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "value": [
                                            " )"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        " ",
                                        "DigoxinOrdered"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "value": [
                                "\n    "
                              ]
                            },
                            {
                              "r": "104",
                              "s": [
                                {
                                  "value": [
                                    "return "
                                  ]
                                },
                                {
                                  "r": "103",
                                  "s": [
                                    {
                                      "s": [
                                        {
                                          "r": "85",
                                          "s": [
                                            {
                                              "r": "84",
                                              "s": [
                                                {
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "DigoxinOrdered"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "value": [
                                                " ",
                                                "Order"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "s": [
                                        {
                                          "value": [
                                            "let "
                                          ]
                                        },
                                        {
                                          "r": "100",
                                          "s": [
                                            {
                                              "value": [
                                                "MedicationStrength",
                                                ": "
                                              ]
                                            },
                                            {
                                              "r": "99",
                                              "s": [
                                                {
                                                  "value": [
                                                    "(\n        "
                                                  ]
                                                },
                                                {
                                                  "r": "99",
                                                  "s": [
                                                    {
                                                      "value": [
                                                        "case\n          "
                                                      ]
                                                    },
                                                    {
                                                      "r": "91",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "when "
                                                          ]
                                                        },
                                                        {
                                                          "r": "89",
                                                          "s": [
                                                            {
                                                              "r": "87",
                                                              "s": [
                                                                {
                                                                  "r": "86",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "Order"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "."
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "87",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "refills"
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "r": "88",
                                                              "value": [
                                                                " ",
                                                                ">",
                                                                " ",
                                                                "10"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "90",
                                                          "value": [
                                                            " then ",
                                                            "true"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "value": [
                                                        "\n          "
                                                      ]
                                                    },
                                                    {
                                                      "r": "97",
                                                      "s": [
                                                        {
                                                          "value": [
                                                            "when "
                                                          ]
                                                        },
                                                        {
                                                          "r": "95",
                                                          "s": [
                                                            {
                                                              "r": "93",
                                                              "s": [
                                                                {
                                                                  "r": "92",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "Order"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "value": [
                                                                    "."
                                                                  ]
                                                                },
                                                                {
                                                                  "r": "93",
                                                                  "s": [
                                                                    {
                                                                      "value": [
                                                                        "refills"
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "r": "94",
                                                              "value": [
                                                                " ",
                                                                "<",
                                                                " ",
                                                                "10"
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "r": "96",
                                                          "value": [
                                                            " then ",
                                                            "false"
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "r": "98",
                                                      "value": [
                                                        " \n          else ",
                                                        "null",
                                                        " end"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "value": [
                                                    "\n      )"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "value": [
                                        "\n      "
                                      ]
                                    },
                                    {
                                      "r": "102",
                                      "s": [
                                        {
                                          "value": [
                                            "return "
                                          ]
                                        },
                                        {
                                          "r": "101",
                                          "s": [
                                            {
                                              "value": [
                                                "MedicationStrength"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "105",
                  "locator": "15:3-23:31",
                  "type": "Query",
                  "source": [
                    {
                      "localId": "83",
                      "locator": "15:3-15:88",
                      "alias": "DigoxinOrdered",
                      "expression": {
                        "localId": "82",
                        "locator": "15:3-15:73",
                        "name": "More Than One Order",
                        "type": "FunctionRef",
                        "operand": [
                          {
                            "localId": "6",
                            "locator": "15:27-15:70",
                            "dataType": "{urn:healthit-gov:qdm:v5_6}PositiveMedicationOrder",
                            "templateId": "PositiveMedicationOrder",
                            "codeProperty": "code",
                            "codeComparator": "in",
                            "type": "Retrieve",
                            "codes": {
                              "locator": "15:49-15:69",
                              "name": "Digoxin Medications",
                              "preserve": true,
                              "type": "ValueSetRef"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "relationship": [],
                  "return": {
                    "localId": "104",
                    "locator": "16:5-23:31",
                    "expression": {
                      "localId": "103",
                      "locator": "16:12-23:31",
                      "type": "Query",
                      "source": [
                        {
                          "localId": "85",
                          "locator": "16:12-16:31",
                          "alias": "Order",
                          "expression": {
                            "localId": "84",
                            "locator": "16:12-16:25",
                            "name": "DigoxinOrdered",
                            "type": "AliasRef"
                          }
                        }
                      ],
                      "let": [
                        {
                          "localId": "100",
                          "locator": "17:11-22:7",
                          "identifier": "MedicationStrength",
                          "expression": {
                            "localId": "99",
                            "locator": "17:31-22:7",
                            "type": "Case",
                            "caseItem": [
                              {
                                "localId": "91",
                                "locator": "19:11-19:43",
                                "when": {
                                  "localId": "89",
                                  "locator": "19:16-19:33",
                                  "type": "Greater",
                                  "operand": [
                                    {
                                      "localId": "87",
                                      "locator": "19:16-19:28",
                                      "path": "refills",
                                      "scope": "Order",
                                      "type": "Property"
                                    },
                                    {
                                      "localId": "88",
                                      "locator": "19:32-19:33",
                                      "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                                      "value": "10",
                                      "type": "Literal"
                                    }
                                  ]
                                },
                                "then": {
                                  "localId": "90",
                                  "locator": "19:40-19:43",
                                  "valueType": "{urn:hl7-org:elm-types:r1}Boolean",
                                  "value": "true",
                                  "type": "Literal"
                                }
                              },
                              {
                                "localId": "97",
                                "locator": "20:11-20:44",
                                "when": {
                                  "localId": "95",
                                  "locator": "20:16-20:33",
                                  "type": "Less",
                                  "operand": [
                                    {
                                      "localId": "93",
                                      "locator": "20:16-20:28",
                                      "path": "refills",
                                      "scope": "Order",
                                      "type": "Property"
                                    },
                                    {
                                      "localId": "94",
                                      "locator": "20:32-20:33",
                                      "valueType": "{urn:hl7-org:elm-types:r1}Integer",
                                      "value": "10",
                                      "type": "Literal"
                                    }
                                  ]
                                },
                                "then": {
                                  "localId": "96",
                                  "locator": "20:40-20:44",
                                  "valueType": "{urn:hl7-org:elm-types:r1}Boolean",
                                  "value": "false",
                                  "type": "Literal"
                                }
                              }
                            ],
                            "else": {
                              "asType": "{urn:hl7-org:elm-types:r1}Boolean",
                              "type": "As",
                              "operand": {
                                "localId": "98",
                                "locator": "21:16-21:19",
                                "type": "Null"
                              }
                            }
                          }
                        }
                      ],
                      "relationship": [],
                      "return": {
                        "localId": "102",
                        "locator": "23:7-23:31",
                        "expression": {
                          "localId": "101",
                          "locator": "23:14-23:31",
                          "name": "MedicationStrength",
                          "type": "QueryLetRef"
                        }
                      }
                    }
                  }
                }
              },
              {
                "localId": "109",
                "locator": "11:1-12:30",
                "name": "Initial Population",
                "context": "Patient",
                "accessLevel": "Public",
                "annotation": [
                  {
                    "type": "Annotation",
                    "s": {
                      "r": "109",
                      "s": [
                        {
                          "value": [
                            "",
                            "define ",
                            "\"Initial Population\"",
                            ":\n  "
                          ]
                        },
                        {
                          "r": "108",
                          "s": [
                            {
                              "value": [
                                "exists "
                              ]
                            },
                            {
                              "r": "107",
                              "s": [
                                {
                                  "value": [
                                    "\"test when then case\""
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "localId": "108",
                  "locator": "12:3-12:30",
                  "type": "Exists",
                  "operand": {
                    "localId": "107",
                    "locator": "12:10-12:30",
                    "name": "test when then case",
                    "type": "ExpressionRef"
                  }
                }
              }
            ]
          }
        }
      },
      "cql": "library TestWhenCase version '0.0.008'\r\n\r\nusing QDM version '5.6'\r\n\r\nvalueset \"Digoxin Medications\": 'urn:oid:2.16.840.1.113883.3.464.1003.1065'\r\n\r\nparameter \"Measurement Period\" Interval<DateTime>\r\n\r\ncontext Patient\r\n\r\ndefine \"Initial Population\":\r\n  exists \"test when then case\"\r\n\r\ndefine \"test when then case\":\r\n  ( \"More Than One Order\"([\"Medication, Order\": \"Digoxin Medications\"]) ) DigoxinOrdered\r\n    return DigoxinOrdered Order\r\n      let MedicationStrength: ( case\r\n          when Order.refills > 10 then true\r\n          when Order.refills < 10 then false \r\n          else null end\r\n      )\r\n      return MedicationStrength\r\n\r\ndefine function \"More Than One Order\"(Medication List<\"Medication, Order\">):\r\n  \"Medication\" OrderMedication1\r\n    with \"Medication\" OrderMedication2\r\n      such that ( OrderMedication1.authorDatetime during \"Measurement Period\"\r\n          and OrderMedication1.refills >= 1\r\n      )\r\n        or ( date from OrderMedication1.authorDatetime !~ date from OrderMedication2.authorDatetime\r\n            and OrderMedication1.authorDatetime during \"Measurement Period\"\r\n            and OrderMedication2.authorDatetime during \"Measurement Period\"\r\n        )\r\n        or ( date from OrderMedication1.authorDatetime ~ date from OrderMedication2.authorDatetime\r\n            and OrderMedication1.authorDatetime during \"Measurement Period\"\r\n            and date from start of OrderMedication1.relevantPeriod !~ date from start of OrderMedication2.relevantPeriod\r\n            and start of OrderMedication1.relevantPeriod during \"Measurement Period\"\r\n            and start of OrderMedication2.relevantPeriod during \"Measurement Period\"\r\n        )\r\n    return OrderMedication1",
      "elm_annotations": {
        "statements": [
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define function \"More Than One Order\"(Medication "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "List<"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "\"Medication, Order\""
                              }
                            ]
                          }
                        ],
                        "ref_id": "7"
                      },
                      {
                        "children": [
                          {
                            "text": ">"
                          }
                        ]
                      }
                    ],
                    "ref_id": "8"
                  },
                  {
                    "children": [
                      {
                        "text": " ):\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Medication\""
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "OperandRef",
                                    "ref_id": "9"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " OrderMedication1"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "10"
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "text": "\n    "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "with "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "\"Medication\""
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "OperandRef",
                                    "ref_id": "11"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " OrderMedication2"
                                      }
                                    ]
                                  }
                                ],
                                "ref_id": "12"
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      such that "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "( "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "OrderMedication1"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "13"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "authorDatetime"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "14"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "14"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " during "
                                                      }
                                                    ],
                                                    "node_type": "In",
                                                    "ref_id": "16"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Measurement Period\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "ParameterRef",
                                                    "ref_id": "15"
                                                  }
                                                ],
                                                "node_type": "In",
                                                "ref_id": "16"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n          and "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "OrderMedication1"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "17"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "refills"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "18"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "18"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " >= 1"
                                                      }
                                                    ],
                                                    "node_type": "Literal",
                                                    "ref_id": "19"
                                                  }
                                                ],
                                                "node_type": "GreaterOrEqual",
                                                "ref_id": "20"
                                              }
                                            ],
                                            "node_type": "And",
                                            "ref_id": "21"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n      )"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "And",
                                        "ref_id": "21"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        or "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "( "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "date from "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "OrderMedication1"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "22"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "."
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "authorDatetime"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "23"
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "23"
                                                          }
                                                        ],
                                                        "node_type": "DateFrom",
                                                        "ref_id": "24"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " !~ "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "date from "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "OrderMedication2"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "25"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "."
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "authorDatetime"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "26"
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "26"
                                                          }
                                                        ],
                                                        "node_type": "DateFrom",
                                                        "ref_id": "27"
                                                      }
                                                    ],
                                                    "node_type": "Not",
                                                    "ref_id": "29"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\n            and "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "OrderMedication1"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "30"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "."
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "authorDatetime"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "31"
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "31"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " during "
                                                          }
                                                        ],
                                                        "node_type": "In",
                                                        "ref_id": "33"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "\"Measurement Period\""
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "ParameterRef",
                                                        "ref_id": "32"
                                                      }
                                                    ],
                                                    "node_type": "In",
                                                    "ref_id": "33"
                                                  }
                                                ],
                                                "node_type": "And",
                                                "ref_id": "34"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n            and "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "OrderMedication2"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "35"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "authorDatetime"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "36"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "36"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " during "
                                                      }
                                                    ],
                                                    "node_type": "In",
                                                    "ref_id": "38"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Measurement Period\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "ParameterRef",
                                                    "ref_id": "37"
                                                  }
                                                ],
                                                "node_type": "In",
                                                "ref_id": "38"
                                              }
                                            ],
                                            "node_type": "And",
                                            "ref_id": "39"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n        )"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "And",
                                        "ref_id": "39"
                                      }
                                    ],
                                    "node_type": "Or",
                                    "ref_id": "40"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": "\n        or "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "( "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "date from "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "OrderMedication1"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "41"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "authorDatetime"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "42"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "42"
                                                              }
                                                            ],
                                                            "node_type": "DateFrom",
                                                            "ref_id": "43"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " ~ "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "date from "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "OrderMedication2"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "44"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "authorDatetime"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "45"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "45"
                                                              }
                                                            ],
                                                            "node_type": "DateFrom",
                                                            "ref_id": "46"
                                                          }
                                                        ],
                                                        "node_type": "Equivalent",
                                                        "ref_id": "47"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\n            and "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "OrderMedication1"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "ref_id": "48"
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "."
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "authorDatetime"
                                                                      }
                                                                    ]
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "49"
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "49"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": " during "
                                                              }
                                                            ],
                                                            "node_type": "In",
                                                            "ref_id": "51"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "\"Measurement Period\""
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "ParameterRef",
                                                            "ref_id": "50"
                                                          }
                                                        ],
                                                        "node_type": "In",
                                                        "ref_id": "51"
                                                      }
                                                    ],
                                                    "node_type": "And",
                                                    "ref_id": "52"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\n            and "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "date from "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "start of "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "OrderMedication1"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "53"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "relevantPeriod"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "54"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "54"
                                                              }
                                                            ],
                                                            "node_type": "Start",
                                                            "ref_id": "55"
                                                          }
                                                        ],
                                                        "node_type": "DateFrom",
                                                        "ref_id": "56"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " !~ "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "date from "
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "start of "
                                                                  }
                                                                ]
                                                              },
                                                              {
                                                                "children": [
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "OrderMedication2"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "ref_id": "57"
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "text": "."
                                                                      }
                                                                    ]
                                                                  },
                                                                  {
                                                                    "children": [
                                                                      {
                                                                        "children": [
                                                                          {
                                                                            "text": "relevantPeriod"
                                                                          }
                                                                        ]
                                                                      }
                                                                    ],
                                                                    "node_type": "Property",
                                                                    "ref_id": "58"
                                                                  }
                                                                ],
                                                                "node_type": "Property",
                                                                "ref_id": "58"
                                                              }
                                                            ],
                                                            "node_type": "Start",
                                                            "ref_id": "59"
                                                          }
                                                        ],
                                                        "node_type": "DateFrom",
                                                        "ref_id": "60"
                                                      }
                                                    ],
                                                    "node_type": "Not",
                                                    "ref_id": "62"
                                                  }
                                                ],
                                                "node_type": "And",
                                                "ref_id": "63"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n            and "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "start of "
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "OrderMedication1"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "64"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "."
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "relevantPeriod"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "65"
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "65"
                                                      }
                                                    ],
                                                    "node_type": "Start",
                                                    "ref_id": "66"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " during "
                                                      }
                                                    ],
                                                    "node_type": "In",
                                                    "ref_id": "68"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "\"Measurement Period\""
                                                          }
                                                        ]
                                                      }
                                                    ],
                                                    "node_type": "ParameterRef",
                                                    "ref_id": "67"
                                                  }
                                                ],
                                                "node_type": "In",
                                                "ref_id": "68"
                                              }
                                            ],
                                            "node_type": "And",
                                            "ref_id": "69"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n            and "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "start of "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "OrderMedication2"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "ref_id": "70"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": "."
                                                          }
                                                        ]
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "relevantPeriod"
                                                              }
                                                            ]
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "71"
                                                      }
                                                    ],
                                                    "node_type": "Property",
                                                    "ref_id": "71"
                                                  }
                                                ],
                                                "node_type": "Start",
                                                "ref_id": "72"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " during "
                                                  }
                                                ],
                                                "node_type": "In",
                                                "ref_id": "74"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "\"Measurement Period\""
                                                      }
                                                    ]
                                                  }
                                                ],
                                                "node_type": "ParameterRef",
                                                "ref_id": "73"
                                              }
                                            ],
                                            "node_type": "In",
                                            "ref_id": "74"
                                          }
                                        ],
                                        "node_type": "And",
                                        "ref_id": "75"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": "\n        )"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "And",
                                    "ref_id": "75"
                                  }
                                ],
                                "node_type": "Or",
                                "ref_id": "76"
                              }
                            ],
                            "ref_id": "77"
                          },
                          {
                            "children": [
                              {
                                "text": "\n    "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "text": "return "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "OrderMedication1"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "AliasRef",
                                "ref_id": "78"
                              }
                            ],
                            "ref_id": "79"
                          }
                        ],
                        "node_type": "Query",
                        "ref_id": "80"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "80"
                  }
                ],
                "ref_id": "81"
              }
            ],
            "define_name": "More Than One Order"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"test when then case\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "( "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "\"More Than One Order\"("
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "[\"Medication, Order\": "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "\"Digoxin Medications\""
                                                  }
                                                ]
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "]"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Retrieve",
                                        "ref_id": "6"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": ")"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "FunctionRef",
                                    "ref_id": "82"
                                  },
                                  {
                                    "children": [
                                      {
                                        "text": " )"
                                      }
                                    ]
                                  }
                                ],
                                "node_type": "FunctionRef",
                                "ref_id": "82"
                              },
                              {
                                "children": [
                                  {
                                    "text": " DigoxinOrdered"
                                  }
                                ]
                              }
                            ],
                            "ref_id": "83"
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "text": "\n    "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "return "
                              }
                            ]
                          },
                          {
                            "children": [
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "DigoxinOrdered"
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "AliasRef",
                                        "ref_id": "84"
                                      },
                                      {
                                        "children": [
                                          {
                                            "text": " Order"
                                          }
                                        ]
                                      }
                                    ],
                                    "ref_id": "85"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "let "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "MedicationStrength: "
                                          }
                                        ]
                                      },
                                      {
                                        "children": [
                                          {
                                            "children": [
                                              {
                                                "text": "(\n        "
                                              }
                                            ]
                                          },
                                          {
                                            "children": [
                                              {
                                                "children": [
                                                  {
                                                    "text": "case\n          "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "when "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "Order"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "86"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "."
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "refills"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "87"
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "87"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " > 10"
                                                          }
                                                        ],
                                                        "node_type": "Literal",
                                                        "ref_id": "88"
                                                      }
                                                    ],
                                                    "ref_id": "89"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " then true"
                                                      }
                                                    ],
                                                    "ref_id": "90"
                                                  }
                                                ],
                                                "ref_id": "91"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": "\n          "
                                                  }
                                                ]
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "children": [
                                                      {
                                                        "text": "when "
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "children": [
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "Order"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "ref_id": "92"
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "text": "."
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "children": [
                                                              {
                                                                "children": [
                                                                  {
                                                                    "text": "refills"
                                                                  }
                                                                ]
                                                              }
                                                            ],
                                                            "node_type": "Property",
                                                            "ref_id": "93"
                                                          }
                                                        ],
                                                        "node_type": "Property",
                                                        "ref_id": "93"
                                                      },
                                                      {
                                                        "children": [
                                                          {
                                                            "text": " < 10"
                                                          }
                                                        ],
                                                        "node_type": "Literal",
                                                        "ref_id": "94"
                                                      }
                                                    ],
                                                    "ref_id": "95"
                                                  },
                                                  {
                                                    "children": [
                                                      {
                                                        "text": " then false"
                                                      }
                                                    ],
                                                    "ref_id": "96"
                                                  }
                                                ],
                                                "ref_id": "97"
                                              },
                                              {
                                                "children": [
                                                  {
                                                    "text": " \n          else null end"
                                                  }
                                                ],
                                                "node_type": "Null",
                                                "ref_id": "98"
                                              }
                                            ],
                                            "node_type": "Case",
                                            "ref_id": "99"
                                          },
                                          {
                                            "children": [
                                              {
                                                "text": "\n      )"
                                              }
                                            ]
                                          }
                                        ],
                                        "node_type": "Case",
                                        "ref_id": "99"
                                      }
                                    ],
                                    "ref_id": "100"
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "text": "\n      "
                                  }
                                ]
                              },
                              {
                                "children": [
                                  {
                                    "children": [
                                      {
                                        "text": "return "
                                      }
                                    ]
                                  },
                                  {
                                    "children": [
                                      {
                                        "children": [
                                          {
                                            "text": "MedicationStrength"
                                          }
                                        ]
                                      }
                                    ],
                                    "node_type": "QueryLetRef",
                                    "ref_id": "101"
                                  }
                                ],
                                "ref_id": "102"
                              }
                            ],
                            "node_type": "Query",
                            "ref_id": "103"
                          }
                        ],
                        "ref_id": "104"
                      }
                    ],
                    "node_type": "Query",
                    "ref_id": "105"
                  }
                ],
                "ref_id": "106"
              }
            ],
            "define_name": "test when then case"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "children": [
                      {
                        "text": "define \"Initial Population\":\n  "
                      }
                    ]
                  },
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "text": "exists "
                          }
                        ]
                      },
                      {
                        "children": [
                          {
                            "children": [
                              {
                                "text": "\"test when then case\""
                              }
                            ]
                          }
                        ],
                        "node_type": "ExpressionRef",
                        "ref_id": "107"
                      }
                    ],
                    "node_type": "Exists",
                    "ref_id": "108"
                  }
                ],
                "ref_id": "109"
              }
            ],
            "define_name": "Initial Population"
          }
        ],
        "identifier": {
          "id": "TestWhenCase",
          "version": "0.0.008"
        }
      },
      "statement_dependencies": [
        {
          "_id": "65c4ea736068b11663b7481e",
          "statement_name": "Patient",
          "statement_references": []
        },
        {
          "_id": "65c4ea736068b11663b7481f",
          "statement_name": "More Than One Order",
          "statement_references": []
        },
        {
          "_id": "65c4ea736068b11663b74820",
          "statement_name": "test when then case",
          "statement_references": [
            {
              "_id": "65c4ea736068b11663b74821",
              "library_name": "TestWhenCase",
              "statement_name": "More Than One Order"
            }
          ]
        },
        {
          "_id": "65c4ea736068b11663b74822",
          "statement_name": "Initial Population",
          "statement_references": [
            {
              "_id": "65c4ea736068b11663b74823",
              "library_name": "TestWhenCase",
              "statement_name": "test when then case"
            }
          ]
        }
      ]
    }
  ],
  "population_sets": [
    {
      "_id": "65c4ea736068b11663b74825",
      "title": "Population Criteria Section",
      "population_set_id": "PopulationSet_1",
      "populations": {
        "_id": "65c4ea736068b11663b74826",
        "_type": "CQM::CohortPopulationMap",
        "IPP": {
          "_id": "65c4ea736068b11663b74827",
          "library_name": "TestWhenCase",
          "statement_name": "Initial Population",
          "hqmf_id": "8507F30A-36AB-4B77-9C71-EB6BF7ECCD30"
        }
      },
      "stratifications": [],
      "supplemental_data_elements": [],
      "observations": []
    }
  ]
}